$ sudo apt-get install cscope2. 將cscope_maps.vim內容加入.vimrc
http://cscope.sourceforge.net/cscope_maps.vim
3. 產生ctags關聯檔
$ find . -name *."[ch]" > cscope.files $ ctags -L cscope.files $ cscope -Rbki cscope.files -R Recurse directories for files. -b Build the cross-reference only. -k Kernel Mode - don't use /usr/include for #include files. -i namefile Browse through files listed in namefile, instead of cscope.files4. HOW TO USE WITH VI
一個範例: cs find s5. 參考來源" 's' symbol: find all references to the token under cursor " 'g' global: find global definition(s) of the token under cursor " 'c' calls: find all calls to the function name under cursor " 't' text: find all instances of the text under cursor " 'e' egrep: egrep search for the word under cursor " 'f' file: open the filename under cursor " 'i' includes: find files that include the filename under cursor " 'd' called: find functions that function under cursor calls
http://cscope.sourceforge.net/
沒有留言:
張貼留言