匹配时的Vim%匹配也包含在引用文本中

时间:2012-04-23 13:16:00

标签: perl vim match quote

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

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

假设:

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

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

目的是使用嵌入的引用代码片段导航Data :: Dumper转储。

在我阅读文档时,matchit插件无法处理这种情况。

首选Cluestick指针。

1 个答案:

答案 0 :(得分: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.