gen_tags.vim will detect SCM(git, hg, svn) root and use it as the project root path. But you can also create a folder named as
.root to specify a directory as the project root path.
Generate/Update ctags and gtags will run in background.
GNU global(aka gtags) is more powerful than ctags, which support definition, reference, calling, called, include, string and etc, but ctags only support definition.
As we can use GNU global why did I still support ctags in this plugin? That's because GNU global only support 6 languages (C, C++, Yacc, Java, PHP4 and assembly) natively. ctags can support more languages(41 showed on the website).
Actually global can support more languages with Pygments plugin parser, for more details please refer
PLUGIN_HOWTO.pygments in global document.
call dein#add('jsfaint/gen_tags.vim') to your vimrc
nvim and run
Plug 'jsfaint/gen_tags.vim' to your vimrc
vim/nvim and run
Unzip the zip file under your .vim(*unix) or vimfiles(windows) directory.
Generate ctags database
Edit an extend configuration file for this project, use for add third-party library ctags database The extend database will be generate automatically.
e.g.: For libpcap under
e:\src\libpcap-1.3.0 add the following content to
:ClearCtags Remove tags files. :ClearCtags! Remove all files, include the db dir
GTAGS support the third-party library by set an environment variable
But you can take a more straightforward way to do the same thing, by create a symbol link of the library
ln -s /usr/include/ .
mklink /J include C:\TDM-GCC-32\include
:ClearGTAGS Remove GTAGS files :ClearGTAGS! Remove all files, include the db dir
ctrl+] is the default mapping support by Vim for definition
The following mapping is set for gtags when
g:gen_tags#gtags_default_map is 1,
which uses the
cscope interface .
Ctrl+\ c Find functions calling this function Ctrl+\ d Find functions called by this function Ctrl+\ e Find this egrep pattern Ctrl+\ f Find this file Ctrl+\ g Find this definition Ctrl+\ i Find files #including this file Ctrl+\ s Find this C symbol Ctrl+\ t Find this text string
For more details about the usage, please refer to the help document in vim by
Thanks for reading :) If you like this plugin, please star it on github!
And one more thing, bug reports and pull-requests are greatly appreciated :)