Skip to content

Commit

Permalink
Plugins vim-easytags and tagbar
Browse files Browse the repository at this point in the history
These give you the power to see what kinds of methods, variables,
functions, and other types of declarations you have in your files. It
relies on a program called ctags being installed, and normally you have
to run ctags to generate the `tags` file for the plugin to work.
Luckily, there is another plugin that makes generating this tags file
easy: vim-easytags. It automatically generates the tags file in the
background whenever you save, so you never have to worry about the tags
file getting out of date.

If you're wondering why `tags` files start showing up in random places,
this is it.
  • Loading branch information
jez committed Feb 25, 2015
1 parent 144f979 commit fd2c49c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions vimrc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Plugin 'bling/vim-airline'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'scrooloose/syntastic'
Plugin 'xolox/vim-misc'
Plugin 'xolox/vim-easytags'
Plugin 'majutsushi/tagbar'

call vundle#end()

Expand Down Expand Up @@ -81,3 +84,19 @@ augroup mySyntastic
augroup END


" ----- xolox/vim-easytags settings -----
" Where to look for tags files
set tags=./tags;,~/.vimtags
" Sensible defaults
let g:easytags_events = ['BufReadPost', 'BufWritePost']
let g:easytags_async = 1
let g:easytags_dynamic_files = 2
let g:easytags_resolve_links = 1
let g:easytags_suppress_ctags_warning = 1

" ----- majutsushi/tagbar settings -----
" Open/close tagbar with \b
nmap <silent> <leader>b :TagbarToggle<CR>
" Uncomment to open tagbar automatically whenever possible
"autocmd BufEnter * nested :call tagbar#autoopen(0)

5 comments on commit fd2c49c

@jez
Copy link
Owner Author

@jez jez commented on fd2c49c Feb 26, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(<-- prev step) ... (next step -->)

There are a number of plugins being installed here.

vim-misc is a dependency of vim-easytags

vim-easytags is a plugin that generates tags files, which is a compiled index of all the functions, variables, and identifies that you use in your project.

tagbar is a plugin that reads your tags files and displays the information in an accessible way inside Vim.

Most of everything is configured out of the box, and you can press ? inside the tagbar buffer to learn how to use it (after opening it with \b). For more information,

@majutsushi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small correction here: Tagbar doesn't read the tags files, it reads the ctags output from its stdout. So it works even if there aren't any tags files around.

@sbhal
Copy link

@sbhal sbhal commented on fd2c49c Jun 10, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow I founded ''vim-easytags" slow on my system. Then I tried https://github.com/szw/vim-tags and tags updates on fly and vim is responsive.

@gyosh
Copy link

@gyosh gyosh commented on fd2c49c Feb 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a beginner, I'd like to emphasize:

It relies on a program called ctags being installed

So remember that you need to install ctags in your system, something like apt-get install exuberant-ctags.

I'm also beginner, and I spent some time confused about what the error message Tagbar: Ctags doesn't seem to be Exuberant Ctags! means πŸ˜…

@belr20
Copy link

@belr20 belr20 commented on fd2c49c Feb 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

First of all, many thanks to @jez for this GREAT & AWESOME educational work πŸ™
As Tagbar VIM plugin is now maintained by PreserVIM, this is the updated link to the repository.

Regards.

Please sign in to comment.