如何在 gvim 中添加自定义单词对来标记块的开头和结尾,以便我可以使用%(就像{and })跳过
我想从 to 跳转functionstart,functionend反之亦然。
functionstart
<code here>
functionend
如何在 gvim 中添加自定义单词对来标记块的开头和结尾,以便我可以使用%(就像{and })跳过
我想从 to 跳转functionstart,functionend反之亦然。
functionstart
<code here>
functionend
就像其他人描述的那样,这是你应该做的:
将 matchit.zipmatchit.vim放入您的目录()中,并将这一行添加到您的. 这将允许使用./plugin/matchit.vim~/.vim/pluginmkdir ~/.vim/plugin if it doesn't exist~/.vimrc%
let b:match_words = '\<functionstart\>:\<functionend\>' "Keyword pairs
如果您想让相同的关键字适用于所有 vim 缓冲区,请将这两行改为
let g:match_words = '\<functionstart\>:\<functionend\>' "Keyword pairs
autocmd BufReadPre * let b:match_words = g:match_words "Buffer specific variable
:help %建议使用matchpairs(仅适用于字符)或matchit插件。
请参阅安装说明,:help matchit-install然后设置特定设置。该文档也可在线获得。:help matchit-configure:help matchit-newlang