Questions tagged «plugin-matchit»

1
如何在选择时突出显示matchit.vim定义的匹配“%”名称(例如if / end,for / end)?
目前,我的Vim用青色背景和白色前景突出显示匹配的括号,方括号,引号等-可以在之间移动光标%。多亏了matchit.vim,我也可以%在if / end,for / end等之间切换。但是,这些在选择时未突出显示。 如何在选择时自动突出显示这些匹配对,就像用括号自动完成一样? 此外,如何使用修改用于这些对的背景色:highlight? 提前致谢。 我已经通过下面的@Tommy A更新了答案,以说明指定的matchit.vim组不正确,以及其他情况下%操作员永远不会将光标返回到原始位置。检查“ while”循环中的差异。建议阅读此线程的任何人都使用此版本,以避免无限循环: function! s:get_match_lines(line) abort " Loop until `%` returns the original line number; abort if " (1) the % operator keeps us on the same line, or " (2) the % operator doesn't return us to the same line after …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.