Trace source at vim
幾個步驟大綱:
- Introduce
- Install
- Setup
- Tag Your Codebase
- Text Editor
- 進階版
[Introduce ]
•Source Insight
–Good IDE
–Good at Windows platform
–Bad Overload files
•But what if you ...
–Non-Windows platform (BSD, Linux, …)
–Command line interface (CLI)
–Dislike brute force search : find / grep
[Tools ]
•vim
•ctags
•taglist
[Install ]
•apt-get install vim
•apt-get install exuberant-ctags
•Download taglist
–Steps:•下載後解壓縮該檔案
# unzip taglist_45.zip•將plugin及doc複製到家目錄的“.vim”目錄裏(~ /.vim/) ,如果不存在就建一個新的".vim"
[setup ]
•Modify /etc/vim/vimrc
–map <f7> :Tlist<CR>
[Tag Your Codebase ]
ctags -R -h ".h.c.cpp.java"
[Text Editor ]

•Keys:
–F7•Enable / Disable ctags–Ctrl + w + w•Switch window–Left side (Tag List):•按Enter就會自動跳到相對應的函式或定義–Right side:•Ctrl + ] : 跳到游標所指function的implement 位置•Ctrl + t : 返回到剛剛的位置
[進階版 ]
•apt-get install cscope
•Download
–trinity.zip http://www.vim.org/scripts/script.php?script_id=2347
–srcexpl.vim http://www.vim.org/scripts/script.php?script_id=2179
–Unzip and put these plugin files to
•~ /.vim/plugin

•Modify /etc/vim/vimrc
" Open and close all the three plugins on the same timenmap <F8> :TrinityToggleAll<CR>" Open and close the srcexpl.vim separatelynmap <F9> :TrinityToggleSourceExplorer<CR>" Open and close the taglist.vim separatelynmap <F10> :TrinityToggleTagList<CR>" Open and close the NERD_tree.vim separatelynmap <F11> :TrinityToggleNERDTree<CR>set mouse=nv
[參考]:
•Ctags:
•Taglist:
•Ubuntu安裝Vim Plugin ctags及taglist
•Vim + Trinity + Source Explorer + Tag List + NERD_tree + ctags
•take it easy:vim+trinity+tabbar