分割視窗並執行 cscope 指令
:scscope
範例
一般模式 0 / 2命令列模式 1 / 2一般模式 2 / 2Paint();游標位於第 1 行,第 1 欄Paint();游標位於第 1 行,第 1 欄void Paint(void) {}游標位於第 1 行,第 1 欄分割視窗並執行 cscope 指令。
已連接 cscope 固定裝置
- 資料庫
/demo/cscope.out- g Paint 的結果
/demo/paint.c line 1: void Paint(void) {}- cscopetagorder
不適用;此處直接查詢 cscope。
視窗
- main.c 使用中
Paint();
指令已輸入。按 Enter 執行。
已連接 cscope 固定裝置
- 資料庫
/demo/cscope.out- g Paint 的結果
/demo/paint.c line 1: void Paint(void) {}- cscopetagorder
不適用;此處直接查詢 cscope。
視窗
- main.c 使用中
Paint();
查詢全域定義 (g),分割視窗並跳至唯一之 Paint 定義。main.c 仍留在另一個視窗。
已連接 cscope 固定裝置
- 資料庫
/demo/cscope.out- g Paint 的結果
/demo/paint.c line 1: void Paint(void) {}- cscopetagorder
不適用;此處直接查詢 cscope。
視窗
- paint.c 使用中
void Paint(void) {}
- main.c
Paint();
操作前後
Paint();游標位於第 1 行,第 1 欄已連接 cscope 固定裝置
- 資料庫
/demo/cscope.out- g Paint 的結果
/demo/paint.c line 1: void Paint(void) {}- cscopetagorder
不適用;此處直接查詢 cscope。
視窗
- main.c 使用中
Paint();
void Paint(void) {}游標位於第 1 行,第 1 欄已連接 cscope 固定裝置
- 資料庫
/demo/cscope.out- g Paint 的結果
/demo/paint.c line 1: void Paint(void) {}- cscopetagorder
不適用;此處直接查詢 cscope。
視窗
- paint.c 使用中
void Paint(void) {}
- main.c
Paint();
主題::scscope。依 Vim 文件示範。此例假設+cscope、可用的 cscope 執行檔、已連接之已準備資料庫、恰好此一個匹配、splitbelow 未設定、switchbuf 為空。未用 Vim 重播驗證。查詢全域定義 (g),分割視窗並跳至唯一之 Paint 定義。main.c 仍留在另一個視窗。
詳細說明與 Vim 文件
需要支援 +cscope 的 Vim,以及相應的執行環境、程式庫或外部工具。本例輸入 :scscope find g Paint 後按 Enter。可簡寫為 :scs。