navigation - vim 中的自定义 block 限制器

标签 navigation vim

如何添加自定义单词对来标记 gvim 中 block 的开头和结尾,以便我可以使用 % 跳转(就像 { })

我想从 functionstart 跳转到 functionend,反之亦然。

functionstart

<code here>

functionend

最佳答案

就像其他人所描述的那样,这是你应该做的:

放置matchit.vimmatchit.zip /plugin/matchit.vim在你的~/.vim/plugin目录( mkdir ~/.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

关于navigation - vim 中的自定义 block 限制器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17707602/

相关文章:

vim - Foldmethod =标记和语法在同一时间?

python - 无法在 Plone 4 的导航 portlet 中安排项目顺序

Wordpress CSS Main Navigation .current-menu-item 变换 :

java - 开发一个带有导航按钮的软件

vim - Vim 中 .gitignore 的语法高亮显示?

vim - 在 Vim 中将编码和文件编码设置为 utf-8

Vim: `cd` 到存储在变量中的路径

html - 在导航下方添加社交媒体图标

html - 导航到#id 时,元素隐藏在固定位置标题下

linux - 使用 vim,什么是 "' < ,'>"?