我正在使用vim进行ruby,php和perl开发.%从块的开头(子程序/函数/方法/ if)跳到结尾有一个快捷方式,反之亦然.对我来说%,ruby中的do/end标签不起作用.
我怎么能用vim做到这一点?
使用matchit插件和〜/ .vim/ftplugin/ruby.vim中的代码现在可以正常工作:)
" Matchit support:
if exists("loaded_matchit")
if !exists("b:match_words")
let b:match_ignorecase = 0
let b:match_words =
\ '\%(\%(\%(^\|[;=]\)\s*\)\@<=\%(class\|module\|while\|begin\|until\|for\|if\|unless\|def\|case\)\|\<do\)\>:' .
\ '\<\%(else\|elsif\|ensure\|rescue\|when\)\>:\%(^\|[^.]\)\@<=\<end\>'
endif
endif
Run Code Online (Sandbox Code Playgroud)