安裝ctags
確認ctags是否安裝
$which ctags
安裝ctags
$sudo apt install ctags
分別下載並安裝如下vim插件
- Taglist:https://www.vim.org/scripts/script.php?script_id=273
- SrcExpl (Source Explorer):https://www.vim.org/scripts/script.php?script_id=2179
- Trinity :https://www.vim.org/scripts/script.php?script_id=2347
將上述地址對應的配置文件寫入vimrc
關於熱鍵的配置
確認terminal本身是否與對應熱鍵如F8,F9等衝突。
使用Ctags
使用Ctags爲目標項目打tags:
如果是android項目,源代碼龐大,需要使用--exclude=命令排除一些目錄,如
ctags --exclude=build --exclude=disregard --exclude=poky --exclude=prebuilts --exclude=.repo -R
僅供參考,實際情況看各自需要。