1. First put all source code file paths in the project into cs5. files:
$ Find/home/jzj/myproject-name "*. h"-o-name "*. C"-o-name "*. CC"> cscope. Files #Note:Use absolute path in the find command, otherwise the tag will not be found once the sub-directory is entered.
2. Create an index:
Cscope-bkq-I cscope. Files # The default value is from cscope. Files.
Ctags-R
3. Use in VIM
Run cscope A cscope. Out in vim or enable Vim to automatically load when it is started in vimrc settings.
: Set tags = ~ /Myproject/tags #Note:Specify the path of the tags file in Vim. Otherwise, the tag cannot be found after entering the subdirectory. This command can be written into vimrc.
Instructions on tag redirection in VIM [conversion]
1. $ ctags-r -- c-types = + px ($ is a Linux shell prompt)
2. $ vi-T tag (replace the tag with the variable or function name you want to find)
3. Ts (the command starting with ":" In tags list and starting with ":" is a command in command line mode in VI)
4. TP (TP note: tags Preview)-This command is not commonly used and does not need to be remembered
5. TN (TN mnemonic: tags next)-This command is not commonly used and does not need to be remembered.
6. Tag/Tag (replace the tag with the variable or function name you want to search)
7. Press Ctrl +] to define the function or declare [+ Tab
8. CTRL + T returned
9. [{go to the previous "{" in the first column "{"
10,}] to the next "{" in the first column "{"
11. {go to the previous blank line
12.} go to the next blank line
13. Gd goes to the definition of the local variable pointed by the current cursor. GF opens the header file.
14. * go to the next occurrence of the word indicated by the current cursor
15. # Go To The last occurrence of the word indicated by the current cursor
16. CTRL + I forward Ctrl + O returns
17. CTRL + z transfers VI to the background, and Fg returns vi
More comprehensive introduction:
Http://blog.chinaunix.net/space.php? Uid = 14163325 & Do = Blog & id = 180214