Cscope on windows often get duplicate list of a symbol in the same file with different filename letter case. This project is created to rebuild the cscope database to remove that duplicates.
[Before you use cscope] Installation
Download cscope.exe
Put cscope.exe under your VIM folder (or any folder)
Add the path of the folder in the environmental variable
Enter 'cscope -v' in command line window to check if cscope has been successfully installed
Download the shortcut mapping file cscope_maps.vim, and put it under your C:Program FilesVimvim73plugin folder
Builde the database for source code
In command line window, cd to the source code folder (XXX_PATH) you'd like to trace
Enter XXX_PATH>dir /s /b *.c *.h *.cpp > cscope.files
Enter XXX_PATH>cscope -b
Add cs a XXX_PATHcscope.out into your _vimrc file
[How to use cscope] Ctrl+ s 's表Symbol,列出所有參考到游標所在字串的地方,包含定義和呼叫。 ctrl+ g 'g表Global,與ctags的Ctrl+]相同。 ctrl+ c 'c表Call,列出所有以游標所在字串當函數名的地方。 ctrl+ t 't表Text,列出專案中所有出現游標所在字串的地方。 ctrl+ f 'f表File,以游標所在字串當檔名,開啟之。 ctrl+ i 'i表Include,以游標所在字串當檔名,列出所有include此檔的檔案。
ctrl+ d 'd表calleD,以游標所在字串當函式名,列出所有此函式呼叫的函式。
[Reference] 1. gvim+cscope in windows
Install Package Control
按下 CTRL+`
貼上
Refer to installation_Package_Control
Install cscope
按下 CTRL+SHIFT+P
先輸入 INSTALL PACKAGE ,之後再輸入 cscope,即可安裝完成
產生 cscope.out
F:ovs>cscope.exe -Rbv
Refer to cscope plugin source
Usage
按下 ctrl+後,根據需求來使用
直接使用 鍵盤操作
Ctrl/Super + - Show Cscope options
Ctrl/Super + LCtrl/Super + S - Look up symbol under cursor
Ctrl/Super + LCtrl/Super + D - Look up definition under cursor
Ctrl/Super + LCtrl/Super + E - Look up functions called by the function under the cursor
Ctrl/Super + LCtrl/Super + R - Look up functions calling the function under the cursor