📅 2017-Aug-24 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ cscope, vim ⬩ 📚 Archive
Cscope provides a rudimentary commandline interface for exploring your C or C++ codebase. But using it along with Vim provides a much richer interface.
Make sure you have installed Cscope and know how to use it. This is explained here.
To be able to use Cscope inside Vim, install the cscope_maps.vim plugin file. This old file can be found mirrored at this Github repository here.
Open Vim in the root of the code directory that has the generated Cscope cross-reference file cscope.out.
Open any source file and move cursor to any symbol and use the following commands: Ctrl-\ s
to jump to any instance of the symbol, Ctrl-\ f
to jump the file under the cursor, Ctrl-\ g
to jump to the definition and Ctrl-\ c
to jump to calls of the function under cursor.
Use the Vim command Ctrl-o
to jump back to previous locations in files.
If you are using a cross-reference file with a filename that is not cscope.out or it is not in the current directory, then export that file path in the CSCOPE_DB
environment variable. Vim will use that path to read the cross-reference file.
Tried with: Cscope 15.8b, Vim 7.4 and Ubuntu 16.04