Lines Matching refs:in
9 The very basics can be found in section |03.9| of the user manual. A few more
10 explanations are in chapter 27 |usr_27.txt|.
18 7. Ignoring case in a pattern |/ignorecase|
68 N Repeat the latest "/" or "?" [count] times in
76 2. the first keyword after the cursor, in the
80 in the current line
106 search stops in line 1. If it is found, Vim goes back
114 searched use the commands listed in |include-search|.
120 global variable that is defined in the file, this
123 always starts in line 1.
142 This command doesn't work in an autocommand, because
177 [num] [num] lines downwards, in column 1
178 +[num] [num] lines downwards, in column 1
179 -[num] [num] lines upwards, in column 1
190 character the cursor lands on is included in operations).
195 /test/+1 one line below "test", in column 1
232 the search, possibly in another direction or with another count. Note that
241 will result in the pattern to match other text.
253 'c' flag in 'cpoptions'. See |cpo-c|.
256 The unpredictability with the 'c' flag is caused by starting the search in the
260 'c' flag in 'cpoptions' as described above. Then the last match before the
265 unless the 't' flag is present in 'cpoptions'. The search pattern is always
266 put in the search history.
278 switched off by setting the 's' flag in the 'shortmess' option. The highlight
294 The "*", "#", "g*" and "g#" commands look for a word near the cursor in this
297 - The first keyword to the right of the cursor, in the same line.
299 - The first WORD to the right of the cursor, in the same line.
300 The keyword may only contain letters and characters in 'iskeyword'.
311 triggered. In most cases this should be fine, but if a pattern is in use when
336 "foobeep\&..." matches "foo" in "foobeep".
337 ".*Peter\&.*Bob" matches in a line containing both "Peter" and "Bob"
364 in the text. It is often an ordinary character or a character class.
398 Some characters in the pattern, such as letters, are taken literally. They
399 match exactly the same character in the text. When preceded with a backslash
408 items in the pattern mentioned next. The 'magic' option should always be set,
498 |/\%l| \%23l \%23l in line 23 |/zero-width|
499 |/\%c| \%23c \%23c in column 23 |/zero-width|
500 |/\%v| \%23v \%23v in virtual column 23 |/zero-width|
557 |/\Z| \Z \Z ignore differences in Unicode "combining characters".
561 |/\m| \m \m 'magic' on for the following chars in the pattern
562 |/\M| \M \M 'magic' off for the following chars in the pattern
563 |/\v| \v \v the following chars in the pattern are "very magic"
564 |/\V| \V \V the following chars in the pattern are "very nomagic"
579 An identifier (e.g., in a C program).
595 matched and in what way. This is called a multi. See |/multi| for an
606 in the buffer
613 position to the last occurrence of "END" in the file. Since the "*"
652 matches "aaab" in "xaaab".
661 a[bc]\{-}[cd] "abc" in "abcd"
662 a[bc]*[cd] "abcd" in "abcd"
668 Like "(?=pattern)" in Perl.
670 foo\(bar\)\@= "foo" in "foobar"
674 in the match. These items are only used to check if a match can be
676 be done in the same position. The last example above will not match
677 "foobarfoo", because it tries match "foo" in the same position where
688 Like "(?!pattern)" in Perl.
697 line, because ".*" can match all characters in the line and the "p"
703 position: "\(foo\)\@!bar" will match "bar" in "foobar", because at the
708 Useful example: to find "foo" in a line that does not contain "bar": >
710 < This pattern first checks that there is not a single position in the
718 Like "(?<=pattern)" in Perl, but Vim allows non-fixed-width patterns.
738 \%#=1\1\@<=,\([a-z]\+\) ",abc" in "abc,abc"
743 \([a-z]\+\)\zs,\1 ",abc" in "abc,abc"
759 before what follows. Thus this matches if there is no position in the
762 Like "(?<!pattern)" in Perl, but Vim allows non-fixed-width patterns.
764 with what follows, thus an atom that ends in ".*" will work.
768 \(foo\)\@<!bar any "bar" that's not in "foobar"
769 \(\/\/.*\)\@<!in "in" which is not after "//"
778 Like "(?>pattern)" in Perl.
786 "aaab", but in the second case the "a*" matches only the first two
803 \^ Matches literal '^'. Can be used at any position in the pattern, but
807 \_^ Matches start-of-line. |/zero-width| Can be used at any position in
814 $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
819 \$ Matches literal '$'. Can be used at any position in the pattern, but
823 \_$ Matches end-of-line. |/zero-width| Can be used at any position in the
854 Can be used multiple times, the last one encountered in a matching
864 Can be used multiple times, the last one encountered in a matching
866 Example: "end\ze\(if\|for\)" matches the "end" in "endif" and
874 For example, to find the first "VIM" in a file: >
880 Note that this does NOT find the last "VIM" in a file: >
883 match. This one will find the last "VIM" in the file: >
885 < This uses |/\@!| to ascertain that "VIM" does NOT match in any
891 stopped match in the area that |gv| would reselect.
902 \%# Matches with the cursor position. Only works when matching in a
903 buffer displayed in a window.
921 < Note that two dots are required to include mark 'e in the match. That
929 \%23l Matches in a specific line.
935 These six can be used to match specific lines in a buffer. The "23"
950 \%23c Matches in a specific column.
956 These six can be used to match specific columns in a buffer or string.
971 Example for matching a single byte in column 44: >
973 < Note that "\%<46c" matches in column 45 when the "." matches a byte in
976 \%23v Matches in a specific virtual column.
982 These six can be used to match specific virtual columns in a buffer or
983 string. When not matching with a buffer in a window, the option
1007 character in column 17: >
1009 < Note that without the "^" to anchor the match in the first column,
1066 When matching in a string instead of buffer text a literal newline
1076 the first sub-expression in \( and \).
1082 in the pattern (going left to right), NOT based on what is matched
1097 A collection. This is a sequence of characters enclosed in square
1098 brackets. It matches any single character in the collection.
1107 The same can be done by including "\n" in the collection. The
1115 do get E769 for internal searching. And be aware that in a
1122 in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'.
1123 - If two characters in the sequence are separated by '-', this is
1128 in the old regexp engine. For example, searching by [\u3000-\u4000]
1157 The square brackets in character class expressions are additional to
1182 character in the form:
1185 - To include a literal ']', '^', '-' or '\' in the collection, put a
1192 any character that's not in "^]-\bdertnoUux". "[\xyz]" matches '\',
1198 included in 'cpoptions':
1211 - Matching with a collection can be slow, because each character in
1212 the text has to be compared with each character in the collection.
1226 < The end-of-word atom "\>" is used to avoid matching "fu" in "full".
1252 7. Ignoring case in a pattern */ignorecase*
1258 When "\c" appears anywhere in the pattern, the whole pattern is handled like
1274 <Nul> characters in the file are stored as <NL> in memory. In the display
1278 character is replaced with a <NL> in the search pattern. What is unusual is
1280 in the file.
1283 When 'fileformat' is "mac", <NL> characters in the file are stored as <CR>
1287 When working with expression evaluation, a <NL> character in the pattern
1288 matches a <NL> in the string. The use of "\n" (backslash n) to match a <NL>
1289 doesn't work there, it only works to match text in the buffer.
1300 When "\Z" appears anywhere in the pattern, all composing characters are
1308 not match in "càt" (where the a has the composing character 0x0300), but
1323 composing characters in the pattern must be found in the text.
1339 Vim's regexes are most similar to Perl's, in terms of what you can do. The
1343 Capability in Vimspeak in Perlspeak ~
1366 by giving you the \_ "modifier": put it in front of a . or a character
1370 - execution of arbitrary code in the regex: (?{perl code})
1387 Define a pattern to highlight in the current window. It will
1404 'hlsearch' is used in all windows, while the pattern defined
1405 with ":match" only exists in the current window. It is kept
1408 'ignorecase' does not apply, use |/\c| in the pattern to
1416 looks for a match in the line where redrawing starts.
1425 available). |matchadd()| does not have this limitation and in
1428 Another example, which highlights all characters in virtual
1432 < To highlight all character that are in virtual column 7: >
1461 Fuzzy matching will match a string, if all the characters in the search string
1462 are present anywhere in the string in the same order. Case is ignored. In a
1464 characters in the search string. If the search string has multiple words, then
1465 each word is matched separately. So the words in the search string can be
1466 present in any order in a string.
1474 - Matches at a camel case character (e.g. Case in CamelCase)
1476 - The number of unmatched characters in a string.
1484 a string in a List of strings. The matchfuzzy() function returns a List of