使用Ctags及Cscope都需要先加入資料庫其方式如下
1.Ctags
在你要開發的目錄下輸入以下指令 ctags -R , 之後則會在該目錄下產生tags.
若你要跨很多資料夾建立多個參考ctags時 ,則必須要如下加入各個路徑在.vimrc
set tags=/linux/include/tags
其中/linux/include/tags是你使用ctags所創見的目錄 ,若有多個tags則把對應的路徑加到前一個並以逗號(,)隔開
2.Cscope
輸入以下指令
cscope -bR
or
cscope -bqk
-b:只建立database就好
-q:建立inverted index file ,他會讓你在開發大型專案更快速的搜尋
-k:kernel model 此flag會告訴cscope不要將source code中的#include的/usr/include底下任何header檔案加入到databse中
reference
1.http://abkabkabkyes.blogspot.tw/2013/10/vim.html
2.http://blog.sina.com.cn/s/blog_530f95e90101ennj.html
3.http://hamisme.blogspot.tw/2013/11/using-cscope-on-large-projects.html
沒有留言:
張貼留言