2014-11-02 132 views
1

我一直在使用vim和ctags來翻譯Perl文件。
我想知道以下內容:
有沒有一種方法/插件,我可以使用,以便我可以按下組合鍵並能夠看到一個函數被調用的所有地方(就像我可以跳轉到定義一個函數或查看與我的項目與ctags的所有文件中具有相同名稱的所有函數的列表)?
我已閱讀關於cscope,但我不確定它是否可用於Perl或有腳本語言的解決方案。如何查看函數在vim中被調用的地方?

+0

cscope支持google show perl上的幾秒鐘。在排除之前嘗試一下。 – romainl 2014-11-02 20:52:32

+0

@romainl:我找不到Perl的任何具體示例,所以我不確定它是否可行,或者它是否會打破我的標籤 – Jim 2014-11-02 20:55:07

+0

難道你不能簡單地嘗試它嗎? – romainl 2014-11-02 21:06:55

回答

0

也許這是你在找什麼:

" Lists lines containing the word under the cursor. Type the line number 
" followed by <CR> to jump to the corresponding line. 
nnoremap [I [I: 
xnoremap [I "vy:<C-u>ilist /<C-r>v<CR>: 

" Same as above but for 'defines' 
nnoremap [D [D: 
xnoremap [D "vy:<C-u>dlist /<C-r>v<CR>: 

然後將光標定位一個字之下,鍵入[I[D