天天看點

ubuntu下vim安裝cscope工具

cscope安裝和使用

cscope是vim适用的工具和插件,通過cscope可以友善的擷取某個函數的定義以及被哪些函數調用。

1.cscope安裝

sudo apt-get install cscope
           
ubuntu下vim安裝cscope工具

2.cscope使用

注:在使用cscope之前需要對源代碼生成索引庫。

(1)生成cscope索引檔案

cscope -Rbq
           

上述的指令會生成3個檔案:cscope.in.out ,cscope.out ,cscope.po.out。其中cscope.out是基本符合的索引,cscope.in.out,cscope.po.out兩個檔案是使用-q的選項生成的,用于加快cscope索引的速度。

ubuntu下vim安裝cscope工具

(2)加載cscope索引檔案

在vim打開代碼檔案之後,添加cscope索引,如下指令

:cscope add cscope.out
           
ubuntu下vim安裝cscope工具

(3)具體的使用,使用指令:cs-h,可以檢視cscope使用說明

ubuntu下vim安裝cscope工具

至此cscope工具的安裝就結束了。非常的簡單,主要用于友善源代碼的閱讀和使用。關于具體的cscope的使用,需要大家在實踐中運用。

其他插件的安裝可以參考小編其他的文章

1.(https://blog.csdn.net/m0_37624499/article/details/89526701)

2.(https://blog.csdn.net/m0_37624499/article/details/90705658)

3.(https://blog.csdn.net/m0_37624499/article/details/90898898)

4.(https://blog.csdn.net/m0_37624499/article/details/90905452)

繼續閱讀