close
1. 安裝 ctags cscope
sudo apt-get update
sudo apt-get ctags cscope
ctags與cscope的區別: ctags是跳轉到標籤定義的地方,
但是如果查找函數在哪裡定義過或標籤在哪裡出現過那麼ctags就無能為力了,這時就需要功能強大的cscope了。
2. VSCode Extension 安裝: CTags Support scope4code
3. ctags
打開terminal後進入源碼目錄下,鍵入
ctags -R -f .tags
產生.tags檔案
4. cscope
打開VSCode,並開啟源碼目錄,按"F1"選擇Cscope: Build database
5. Hotkey
Ref: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf
ctags: <ctrl+t> 跳轉到標籤定義的地方
<ctrl+shift+t> 列出歷史標籤
<ctrl+alt+-> go back
<ctrl+shift+-> go forward
cscope: 按F1後選擇相對應功能
或設定相應對熱鍵
File -> Preferences -> Keyboard Shortcuts 可以自定義hotkey
下列設定供參考
文章標籤
全站熱搜