Skip to content

Instantly share code, notes, and snippets.

@tancnle
Last active July 24, 2017 05:47
Show Gist options
  • Save tancnle/4678501 to your computer and use it in GitHub Desktop.
Save tancnle/4678501 to your computer and use it in GitHub Desktop.
Steps to install ctags on vim
  • brew install ctags
  • Install ctags.vim bundle via git://github.com/vim-scripts/ctags.vim.git
  • Add the following line to your .vimrc
let Tlist_Ctags_Cmd="/usr/local/bin/ctags"
let Tlist_WinWidth=50
map <F8> :!/usr/local/bin/ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
map <F4> :TlistToggle<cr>
  • (Optional) Remap your tagsearch key binding
nnoremap <c-]> g<c-]>
vnoremap <c-]> g<c-]>
  • While in Vim, press <F8> to generate the tags on your current directory
  • Cursor on method/class name, press Ctrl-] to bring up the list of matching tags
  • If you would like to generate ctags for your gemset as well, check out https://github.com/tpope/gem-ctags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment