Simple use process of csflood, ctags, and VIM

Source: Internet
Author: User

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

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.