2

我搜索了 Vim Tips Wiki,在 IRC 上问过,现在你:

是否有一个 Vim 插件可以更改 % 匹配行为以跳过引用或转义匹配?

鉴于:

1  var1{
2     ...
3    { Target = 'blah blah.*}',
4     ...
5    }
6    ...
7    $fem = \};
8  }

将光标放在第 1 行中的 { % 将带您到第 8 行 - 跳过第 3 行中的引用 } 和第 7 行中的转义 }。

目的是通过嵌入引用代码片段的 Data::Dumper 转储进行导航。

根据我阅读的文档,matchit 插件无法处理这种情况。

线索指针首选。

4

1 回答 1

2

从 :h %

When 'cpoptions' contains "M" |cpo-M| backslashes           
    before parens and braces are ignored.  Without "M" the          
number of backslashes matters: an even number doesn't 
match with an odd number.  Thus in "( \) )" and "\( ( \)" the first and last parenthesis match.

cpo 的 M 选项:

M   

When excluded, "%" matching will take backslashes into          
account.  Thus in "( \( )" and "\( ( \)" the outer          
parenthesis match.  When included "%" ignores           
backslashes, which is Vi compatible.
于 2012-04-23T13:21:20.570 回答