I use these to navigate huge codebases (1m+ lines)
Examples are using The Neovim source code.
This is a whirlwind tour intended to whet your whistle, not teach you.
Any questions, just ask!
Tools
Universal Ctags
link
A maintained and improved fork of ctags/exhuberant-ctags.
Contains more than 20+ new languages supported and heavily improved parsers
for PHP and a few others.
You can navigate code
GNU-global
link
A source code tagging system. Can be used in conjunction (not replacing!) with ctags. It provides some other niceties that ctags doesn’t offer.
You can install the most recent version by visiting their site.
Or, if you trust your ppa’s to be up to date
sudo apt install global
GNU-Global is similar to cscope and even provides a common interface to use the built-in cscope
commands with GNU-global. The reason I chose GNU-global over cscope is speed. cscope takes a long time to index a large codebase (from my experiences).
Examples below:
You can find where a function has been called (ER MA GAWD)
You can find where a constant is used.
You can find where a constant is defined
You can probably do other stuff that I don’t know about.
Download gnu-global.
I’ve mirrored their vim plugins onto github and put them
in a format that plugin managers will understand.
Plug 'joereynolds/gtags-scope'
To make life better, do this:
set cscopetag "search both cscopes db and the tags file
Vim has built-in support for cscope and GNU-global provides a cscope interface under
that plugin I linked to.
FZF
link
You can navigate files
You can navigate symbols
You can make your own custom searches, fuzzy makefile completion anyone?
You can do a plain ol’ Grep
Native Vim
gf
will open the file under the cursor.
gx
will open the url under the cursor.