Reprinted please indicate from "LIU Da's csdn blog": http://blog.csdn.net/poechant
Through the vim practice manual (8) vimide-build your own IDE (A) and VIM practice manual (9) vimide-build your own IDE (B) you may not be satisfied with the two blog posts. Because when we use visual
Studio, Eclipse, xcode, and other editors have some very powerful functions, such:
(1) check which functions have been called by a function;
(2) check which functions are called by a function;
(3) check which files contain a file;
(4) Check where a variable has been referenced;
......
1. Install cssag in Linux (for Mac users, skip this step)
First: http://sourceforge.net/projects/cscope/files/
If you are installing cssag on Linux, you can directly:
1./configure
2 make
3 sudo make install
2. Install cssag on MAC (Linux users do not need to pay attention to it)
If you are using a Mac platform, you need to edit src/constants. h and find this Code:
1 # If (BSD | V9 )&&! _ NetBSD __&&! _ FreeBSD __
To:
1 # If (BSD | V9 )&&! _ NetBSD __&&! _ FreeBSD __&&! _ Apple __
Then compile:
1./configure
2 make
3 sudo make install
3. Configure csflood in vimrc
1 setcscopequickfix = s-, C-, D-, I-, T-, e-
4. Generate a cssag File
In the root directory of your project, enter the following command:
1cscope-bqr
The following three files are automatically generated:
5. Import the cscope file in VIM
All csflood files have been generated, but they are not associated with your project. In this case, you can enter vim and enter the following command:
CS indicates scope. Add imports the scope source file to the project. The first parameter is the out file of scope, and the second parameter is the root directory of the project. If you often edit the project, you can write the command to vimrc.
6. Experience csflood
Try to query how many times the conn_set_state function has been called and where it is called. Enter the following command:
: CS find C conn_set_state
Result:
If there are many results, you can use the "CW" command to open the quickfix window and switch the search results.
7. cscope shortcut
(1) specify a symbol
CS find S <symbol>
(2) Search Definition
CS find G <var_name | func_name>
(3) Search for the function called by the function
CS find d <functions_invoked>
(4) Search for the function that calls this function
CS find C <functions_invoking>
(5) Search for a specified string
CS find t <text>
(6) Search for the mode specified by egrip
CS find e <egrip>
(7) Search for files
CS find F <FILENAME>
(8) Search for files containing this file
CS find I <including_files>
8. csing cscope shortcut keys
You can customize csmanager shortcut keys. The method can be similar to the custom "WM" when using winmanager ".
Not yet resumed. Welcome to continue with the following blog :)
Reprinted please indicate from "LIU Da's csdn blog": http://blog.csdn.net/poechant
-