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 に答える