1
- *pattern.txt* For Vim version 9.1. Last change: 2024 Jun 18
1
+ *pattern.txt* For Vim version 9.1. Last change: 2024 Nov 09
2
2
3
3
4
4
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -164,7 +164,7 @@ or auto suspended with nohlsearch plugin. See |nohlsearch-install|.
164
164
165
165
166
166
When 'shortmess' does not include the "S" flag, Vim will automatically show an
167
- index, on which the cursor is. This can look like this: >
167
+ index, on which the cursor is. This can look like this: >
168
168
169
169
[1/5] Cursor is on first of 5 matches.
170
170
[1/>99] Cursor is on first of more than 99 matches.
@@ -757,7 +757,7 @@ overview.
757
757
\([a-z]\+\)\zs,\1 ",abc" in "abc,abc"
758
758
759
759
\@123<=
760
- Like "\@<=" but only look back 123 bytes. This avoids trying lots
760
+ Like "\@<=" but only look back 123 bytes. This avoids trying lots
761
761
of matches that are known to fail and make executing the pattern very
762
762
slow. Example, check if there is a "<" just before "span":
763
763
/<\@1<=span
@@ -783,7 +783,7 @@ overview.
783
783
\(\/\/.*\)\@<!in "in" which is not after "//"
784
784
785
785
\@123<!
786
- Like "\@<!" but only look back 123 bytes. This avoids trying lots of
786
+ Like "\@<!" but only look back 123 bytes. This avoids trying lots of
787
787
matches that are known to fail and make executing the pattern very
788
788
slow.
789
789
@@ -907,7 +907,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
907
907
inside the Visual area put it at the start and just before the end of
908
908
the pattern, e.g.: >
909
909
/\%Vfoo.*ba\%Vr
910
- < This also works if only "foo bar" was Visually selected. This: >
910
+ < This also works if only "foo bar" was Visually selected. This: >
911
911
/\%Vfoo.*bar\%V
912
912
< would match "foo bar" if the Visual selection continues after the "r".
913
913
Only works for the current buffer.
@@ -1014,7 +1014,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
1014
1014
< To match all characters after the current virtual column (where the
1015
1015
cursor is): >
1016
1016
/\%>.v.*
1017
- < Column 17 is not included, because this is a | /zero-width | match. To
1017
+ < Column 17 is not included, because this is a | /zero-width | match. To
1018
1018
include the column use: >
1019
1019
/^.*\%17v.
1020
1020
< This command does the same thing, but also matches when there is no
@@ -1138,11 +1138,11 @@ x A single character, with no special meaning, matches itself
1138
1138
in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'.
1139
1139
- If two characters in the sequence are separated by '-', this is
1140
1140
shorthand for the full list of ASCII characters between them. E.g.,
1141
- "[0-9]" matches any decimal digit. If the starting character exceeds
1142
- the ending character, e.g. [c-a] , E944 occurs. Non-ASCII characters
1141
+ "[0-9]" matches any decimal digit. If the starting character exceeds
1142
+ the ending character, e.g. [c-a] , E944 occurs. Non-ASCII characters
1143
1143
can be used, but the character values must not be more than 256 apart
1144
- in the old regexp engine. For example, searching by [\u3000-\u4000]
1145
- after setting re=1 emits a E945 error. Prepending \%#=2 will fix it.
1144
+ in the old regexp engine. For example, searching by [\u3000-\u4000]
1145
+ after setting re=1 emits a E945 error. Prepending \%#=2 will fix it.
1146
1146
- A character class expression is evaluated to the set of characters
1147
1147
belonging to that character class. The following character classes
1148
1148
are supported:
@@ -1208,7 +1208,7 @@ x A single character, with no special meaning, matches itself
1208
1208
any character that's not in "^]-\bdertnoUux". "[\xyz]" matches '\',
1209
1209
'x', 'y' and 'z'. It's better to use "\\" though, future expansions
1210
1210
may use other characters after '\'.
1211
- - Omitting the trailing ] is not considered an error. "[]" works like
1211
+ - Omitting the trailing ] is not considered an error. "[]" works like
1212
1212
"[]]", it matches the ']' character.
1213
1213
- The following translations are accepted when the 'l' flag is not
1214
1214
included in 'cpoptions' :
@@ -1444,14 +1444,14 @@ Finally, these constructs are unique to Perl:
1444
1444
display you may get unexpected results. That is because Vim
1445
1445
looks for a match in the line where redrawing starts.
1446
1446
1447
- Also see | matcharg() | and | getmatches() | . The former returns
1447
+ Also see | matcharg() | and | getmatches() | . The former returns
1448
1448
the highlight group and pattern of a previous | :match |
1449
1449
command. The latter returns a list with highlight groups and
1450
1450
patterns defined by both | matchadd() | and | :match | .
1451
1451
1452
1452
Highlighting matches using | :match | are limited to three
1453
1453
matches (aside from | :match | , | :2match | and | :3match | are
1454
- available). | matchadd() | does not have this limitation and in
1454
+ available). | matchadd() | does not have this limitation and in
1455
1455
addition makes it possible to prioritize matches.
1456
1456
1457
1457
Another example, which highlights all characters in virtual
@@ -1480,7 +1480,7 @@ Finally, these constructs are unique to Perl:
1480
1480
with the lowest number has priority if several match at the
1481
1481
same position. It uses the match id 3.
1482
1482
The ":3match" command is used by (Vim < 9.0.2054) | matchparen |
1483
- plugin. You are suggested to use ":match" for manual matching
1483
+ plugin. You are suggested to use ":match" for manual matching
1484
1484
and ":2match" for another plugin or even better make use of
1485
1485
the more flexible | matchadd() | (and similar) functions instead.
1486
1486
@@ -1489,10 +1489,10 @@ Finally, these constructs are unique to Perl:
1489
1489
1490
1490
Fuzzy matching refers to matching strings using a non-exact search string.
1491
1491
Fuzzy matching will match a string, if all the characters in the search string
1492
- are present anywhere in the string in the same order. Case is ignored. In a
1492
+ are present anywhere in the string in the same order. Case is ignored. In a
1493
1493
matched string, other characters can be present between two consecutive
1494
- characters in the search string. If the search string has multiple words, then
1495
- each word is matched separately. So the words in the search string can be
1494
+ characters in the search string. If the search string has multiple words, then
1495
+ each word is matched separately. So the words in the search string can be
1496
1496
present in any order in a string.
1497
1497
1498
1498
Fuzzy matching assigns a score for each matched string based on the following
@@ -1511,8 +1511,8 @@ will match the strings "GetPattern", "PatternGet", "getPattern", "patGetter",
1511
1511
"getSomePattern", "MatchpatternGet" etc.
1512
1512
1513
1513
The functions | matchfuzzy() | and | matchfuzzypos() | can be used to fuzzy search
1514
- a string in a List of strings. The matchfuzzy() function returns a List of
1515
- matching strings. The matchfuzzypos() functions returns the List of matches,
1514
+ a string in a List of strings. The matchfuzzy() function returns a List of
1515
+ matching strings. The matchfuzzypos() functions returns the List of matches,
1516
1516
the matching positions and the fuzzy match scores.
1517
1517
1518
1518
The "f" flag of `:vimgrep ` enables fuzzy matching.
0 commit comments