cscope - interactively examine a C program
i.e) cscope -R
i.e) cscope -b -q -k -R
i.e) cscope -d
-sdir Look in dir for additional source files. This option is ignored if source files are given on the command line.
-R Recurse subdirectories during search for source files.
-b Build the cross-reference only.
-q Enable fast symbol lookup via an inverted index. This option causes cscope to create 2 more files (default names ``cscope.in.out'' and ``cscope.po.out'') in addition to the normal database. This allows a faster symbol search algorithm that provides noticeably faster lookup performance for large projects.
-k ``Kernel Mode'', turns off the use of the default include dir (usually /usr/include) when building the database, since kernel source trees generally do not use it.
-d Do not update the cross-reference.
<vim plugin>
$ cd ~/.vim/plugin
$ wget http://cscope.sourceforge.net/cscope_maps.vim
nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>
그밖에 Ctrl + space 로 찾은 결과를 새 Window에서 볼 수 있으며,
nmap <C-@>s :scs find s <C-R>=expand("<cword>")<CR><CR>
Ctrl + space + space 로 Vertical Split도 가능하다.
nmap <C-@><C-@>s :vert scs find s <C-R>=expand("<cword>")<CR><CR>
i.e) cscope -R
i.e) cscope -b -q -k -R
i.e) cscope -d
-sdir Look in dir for additional source files. This option is ignored if source files are given on the command line.
-R Recurse subdirectories during search for source files.
-b Build the cross-reference only.
-q Enable fast symbol lookup via an inverted index. This option causes cscope to create 2 more files (default names ``cscope.in.out'' and ``cscope.po.out'') in addition to the normal database. This allows a faster symbol search algorithm that provides noticeably faster lookup performance for large projects.
-k ``Kernel Mode'', turns off the use of the default include dir (usually /usr/include) when building the database, since kernel source trees generally do not use it.
-d Do not update the cross-reference.
<vim plugin>
$ cd ~/.vim/plugin
$ wget http://cscope.sourceforge.net/cscope_maps.vim
" The following maps all invoke one of the following cscope search types:아래와 같이 Ctrl + \ 에 위 단축 알파벳을 입력하면 된다.
"
" '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
nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>
그밖에 Ctrl + space 로 찾은 결과를 새 Window에서 볼 수 있으며,
nmap <C-@>s :scs find s <C-R>=expand("<cword>")<CR><CR>
Ctrl + space + space 로 Vertical Split도 가능하다.
nmap <C-@><C-@>s :vert scs find s <C-R>=expand("<cword>")<CR><CR>
'Tool > editor & source viewer' 카테고리의 다른 글
Source Explorer - Vim 에서 Source Insight 따라잡기 (0) | 2011.03.01 |
---|---|
vim 이용하기 (내가 필요한 것만...) (0) | 2011.03.01 |
vim 이용 (0) | 2007.12.31 |