Note

Plugins: taglist, ctags, cscope

Convert Vim Editor to Beautiful Source Code Browser for Any Programming Language

Taglist

Taglist provides an overview of the structure of source code files and allows you to efficiently browse through source code files.

Installation

  1. Download taglist.zip from Vim plugins scripts and unzip it into ~/.vim.
  2. add keymapping into ~/.vimrc
    nnoremap   :TlistToggle
    

Ctags

Ctags generates an index (or tag) file of language objects found in source files that allows these items to be quickly and easily located by a text editor or other utility. A tag signifies a language object for which an index entry is available (or, alternatively, the index entry created for that object).

Installation

sudo apt-get install exuberant-ctags

Generate tags

cd linux_source_directory
ctags -R *  # generate tags for all file under current directory recursively

Usages

  • ctrl + ]: Navigating to the function definition from "function call"
  • ctrl + t: Returning back again to function call from the definition

Cscope

cscope is an interactive, screen-oriented tool that allows the user to browse through C source files for specified elements of code.

Installation

sudo apt-get install cscope

Usage

cscope -R # It builds the cscope browsing.
cscope -d