Cssag + Vim

Source: Internet
Author: User
Tags egrep

1. Download vim7.0
Http://download.chinaunix.net/download.php? Id = 21977 & resourceid = 11091

2. Compile Vim
1> Configure support for cssag
./Configure -- enable-csure
2> compile
Make
Make install
Vim is in/usr/share/Vim/vim70 /.

3.download taglist_45.zip
Http://vim.sourceforge.net/scripts/script.php? Script_id = 1, 273
After decompressing the file, the files named taglist.txt and taglist. Vim are copied to the doc and plugin folders under/usr/share/Vim/vim70/respectively.

4. Go to the source code directory to edit and enter the command
Cscope-rbkq
R indicates that all files in the subdirectories are indexed.
B indicates that cssag does not start its own user interface, but only creates a symbolic database.
Q: generate the cssag. In. Out and cssag. Po. out files to speed up the cssag index.
K does not search the/usr/include directory when generating the index file
Ctags-R

5. Download cscope_maps.vim, that is, the cssag shortcut key, and put it in the/usr/share/Vim/vim70/plugin folder.
Http://cscope.sourceforge.net/cscope_maps.vim

6. Run Vim to open the file. If VI is used to open the file, the cssag command is not recognized.
1> jump directly to the start_kernel Function Definition
Vim-T start_kernel
2> use the cssag command. The cssag find command is simplified to cs f.
Cs1_find s ---- find the C language symbol, that is, find the place where the function name, Macro, and enumeration value appear
Cs1_find G ---- find the locations defined by functions, macros, and enumeration, similar to the functions provided by ctags.
Cs1_find D ---- find the function called by this function
Cscope find C ---- find the function that calls this function
Cs1_find T: ---- find the specified string
Cscopeappsfind e ---- find egrep mode, which is equivalent to the egrep function, but the search speed is much faster.
Cs1_find F ---- find and open the file, similar to the find function of VIM
Cs1_find I ---- find the text that contains this file
CTRL +] will jump to the variable or function definition where the cursor is located Ctrl + T to return
3> shortcut keys available for the cssag command
Cs f s start_kernel the shortcut key is to place the cursor at the start_kernel string, press Ctrl +/, and then press s, that is, CTRL +/equals to cs f? Start_kernel, the most convenient thing is to save the symbolic name. To pop up another window, press Ctrl + @ (horizontal window) as the shortcut key and press Ctrl + @ (vertical window) twice in a row ). This shortcut key is defined by cscope_maps.vim downloaded previously. You need to change the key to modify this file.
4> the taglist method is to input tlisttoggle in Vim, but I cannot use it here. The prompt 92: not an editor command: tlisttoggle

 

 

Delicious recently found a blog with many Vim articles.

Http://blog.csdn.net/easwy/

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.