How to view the source code under Linux: I used to install a source insight from Linux, but it needs to be installed here to install this wine.
combination of Ctags+vim :
Today, another tool for viewing source code under Linux is. A combination of Ctags+vim.
If the Vim tool is not installed. Can be installed using sudo apt-get install vim .
If the Ctags tool is not installed. You can install it using the sudo apt-get install ctags .
You can not configure the Apt-get source if you do. Or if there is no VIM configuration, you can refer to the following resources:
http://blog.csdn.net/shaohuazuo/article/details/41721647
Here's how to use the Ctags and VIM tools. And make some simple configurations.
First step: After the installation is complete ctags. The path to the source code needs to be entered. Use the Ctags-r command to generate the Ctags file.
Here is the example of Linux source code: This is the linux3.5 source on the computer/home/zshh/work/driver/kernel/linux35
Go to the directory. Use
<pre name= "code" class= "HTML" >[email protected]:~/work/driver/kernel/linux35_tiny4412$ ctags-r
A tags file is generated after completion.
Step two: You need to set the path to the Ctags file to add a line to the/USR/SHARE/VIM/VIMRC file.
Vim/usr/share/vim/vimrc
Add the following configuration:
Set Tag =/home/zshh/work/driver/kernel/linux35/tags
Step three: Simple to use.
cd/home/zshh/work/driver/kernel/linux35
Vim-t Memset will open the Memset source code file directly.
First enter VIM and then retrieve
$>vim
In vim, enter command line mode and type the following:
: Ta memset
At this point, Vim automatically jumps to the location defined by the memset. If you have more than one definition, Ctags displays multiple number options by default, typing the number you want to see;
Some ctags will display the first definition directly, and if the definition is not what we want to find, you can swap with the Tselect command:
: Tselect memset
Retrieving with cursor position
When editing a file with Vim, first position the cursor to the definition you want to view, as follows:
Ctrl +]//View definition
Ctrl + O//return
The above two commands support recursive operation
ubuntu14.04 configuration. Linux View source code artifact, Ctags+vim