Taglist-like Vim plugin for Rust?


#1

Does anyone know of a Vim plugin similar to taglist for Rust?
Taglist is a source code browser that opens in a side pane. It shows classes, methods, and other declarations.
It’s useful for having an overview, especially of larger projects consisting of multiple files.

I know of racer-vim but it provides jump-to-definition and jump-to-help but not this. There’s also rusty-tags however I was unable to get its output to work with taglist in vim.


#2

I’ve been using tagbar, but it’s not ideal either for rust. What we really need is a good etags implementation for rust.


#3

ya that would be great
I’ve went with NERDTree for now, at least having a file list of the project gives me some overview, together with racer’s jump-to-definition it’s more or less convenient
should probably switch to a real IDE at some point but doesn’t really like something closed-source or overly heavy


#4

The primary reasons I use vim are (1) convenience… I’m already in the terminal and I don’t want to switch to another window; (2) keyboard-oriented: I don’t like using mice; and (3) it’s already installed on most linux/macos boxes. I don’t think any IDE will ever have those features in the near-term…

Really, my rust/vim setup is pretty nice. The only thing missing is something like etags/tagbar/taglist.


#5

More or less all the same reasons for me!

Just at times like this, hunting plugins, I wonder if I’m not spending too much time fighting my editor. Overall it’s nice though and I’m very used to it.


#6

In my vimrc, <space>o is bound to :Outline, which displays the current file’s outline:

The outline can be interactively filtered by typing a pattern. Selecting an item and hitting enter takes you to the definition.

To set it up:

  • Install the fzf plugin.
  • Grab the Outline function.
  • Install ctags.
  • Add this to your ~/.ctags.

#7

What’s not ideal about tagbar? Works great for me.


#8

thanks a lot for the suggestions @mark-i-m @stjepang @lkurusa will check them out!

Edit: looks like tagbar was exactly what I was looking for; the difference with taglist is that it shows only the tags for the current file and not for the entire project, but that’s ok as I have a tree browser too now.


#9

I will try that out @stjepang! Thanks :slight_smile:

@lkurusa If you have used tagbar with C++, you will note the difference :wink:


#10

Just noticed that if a recent version of rust-vim plugin is installed, the changes to ~/.ctags and g:tagbar_type_rust are unnecessary—will even result in every tag being shown twice