我想使用;;
转到c语言函数开始。
例如。
void helloworld() {
}
void helloworld2()
{
}
如果使用[[
,则无法跳过helloworld
函数,[M
,[m
和[{
也不完美。
所以我在~/.vimrc
中添加了nmap
fun! GetFuncBLine()
let num = search("^[^ \t#/]\\{2}.*[^:]\s*$", 'bW')
endfun
nmap <silent> ;; :call GetFuncBLine() <CR>
使用此;;
时,函数开始行无法推送至vim跳转列表,因此CTRL+o
或CTRL+i
将无用
我疯了
答案 0 :(得分:0)
.vimrc:
fun! JumpFuncName()
let lnum = line(".")
execute "normal " . lnum . "G<CR>"
execute "normal \<C-O>"
let num = search("^[^ \t#/]\\{2}.*[^:]\s*$", 'bW')
execute "normal " . num . "G<CR>"
execute "normal \<C-O>"
endfun
nmap <silent> [[ :call JumpFuncName() <CR>