Mercurial > vim
comparison runtime/doc/pattern.txt @ 2033:de5a43c5eedc
Update documentation files.
author | Bram Moolenaar <bram@zimbu.org> |
---|---|
date | Wed, 06 Jan 2010 20:52:26 +0100 |
parents | 5232b9862f23 |
children | 7c8c7c95a865 |
comparison
equal
deleted
inserted
replaced
2032:592032e9e167 | 2033:de5a43c5eedc |
---|---|
1 *pattern.txt* For Vim version 7.2. Last change: 2008 Jul 16 | 1 *pattern.txt* For Vim version 7.2. Last change: 2008 Nov 18 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
30 /{pattern}/{offset}<CR> Search forward for the [count]'th occurrence of | 30 /{pattern}/{offset}<CR> Search forward for the [count]'th occurrence of |
31 {pattern} and go |{offset}| lines up or down. | 31 {pattern} and go |{offset}| lines up or down. |
32 |linewise|. | 32 |linewise|. |
33 | 33 |
34 */<CR>* | 34 */<CR>* |
35 /<CR> Search forward for the [count]'th latest used | 35 /<CR> Search forward for the [count]'th occurrence of the |
36 pattern |last-pattern| with latest used |{offset}|. | 36 latest used pattern |last-pattern| with latest used |
37 | 37 |{offset}|. |
38 //{offset}<CR> Search forward for the [count]'th latest used | 38 |
39 pattern |last-pattern| with new |{offset}|. If | 39 //{offset}<CR> Search forward for the [count]'th occurrence of the |
40 {offset} is empty no offset is used. | 40 latest used pattern |last-pattern| with new |
41 |{offset}|. If {offset} is empty no offset is used. | |
41 | 42 |
42 *?* | 43 *?* |
43 ?{pattern}[?]<CR> Search backward for the [count]'th previous | 44 ?{pattern}[?]<CR> Search backward for the [count]'th previous |
44 occurrence of {pattern} |exclusive|. | 45 occurrence of {pattern} |exclusive|. |
45 | 46 |
46 ?{pattern}?{offset}<CR> Search backward for the [count]'th previous | 47 ?{pattern}?{offset}<CR> Search backward for the [count]'th previous |
47 occurrence of {pattern} and go |{offset}| lines up or | 48 occurrence of {pattern} and go |{offset}| lines up or |
48 down |linewise|. | 49 down |linewise|. |
49 | 50 |
50 *?<CR>* | 51 *?<CR>* |
51 ?<CR> Search backward for the [count]'th latest used | 52 ?<CR> Search backward for the [count]'th occurrence of the |
52 pattern |last-pattern| with latest used |{offset}|. | 53 latest used pattern |last-pattern| with latest used |
53 | 54 |{offset}|. |
54 ??{offset}<CR> Search backward for the [count]'th latest used | 55 |
55 pattern |last-pattern| with new |{offset}|. If | 56 ??{offset}<CR> Search backward for the [count]'th occurrence of the |
56 {offset} is empty no offset is used. | 57 latest used pattern |last-pattern| with new |
58 |{offset}|. If {offset} is empty no offset is used. | |
57 | 59 |
58 *n* | 60 *n* |
59 n Repeat the latest "/" or "?" [count] times. | 61 n Repeat the latest "/" or "?" [count] times. |
60 |last-pattern| {Vi: no count} | 62 |last-pattern| {Vi: no count} |
61 | 63 |
505 |/\v| \v \v the following chars in the pattern are "very magic" | 507 |/\v| \v \v the following chars in the pattern are "very magic" |
506 |/\V| \V \V the following chars in the pattern are "very nomagic" | 508 |/\V| \V \V the following chars in the pattern are "very nomagic" |
507 |/\Z| \Z \Z ignore differences in Unicode "combining characters". | 509 |/\Z| \Z \Z ignore differences in Unicode "combining characters". |
508 Useful when searching voweled Hebrew or Arabic text. | 510 Useful when searching voweled Hebrew or Arabic text. |
509 | 511 |
510 |/\%d| \%d \%d match specified decimal character (eg \%d123 | 512 |/\%d| \%d \%d match specified decimal character (eg \%d123) |
511 |/\%x| \%x \%x match specified hex character (eg \%x2a) | 513 |/\%x| \%x \%x match specified hex character (eg \%x2a) |
512 |/\%o| \%o \%o match specified octal character (eg \%o040) | 514 |/\%o| \%o \%o match specified octal character (eg \%o040) |
513 |/\%u| \%u \%u match specified multibyte character (eg \%u20ac) | 515 |/\%u| \%u \%u match specified multibyte character (eg \%u20ac) |
514 |/\%U| \%U \%U match specified large multibyte character (eg | 516 |/\%U| \%U \%U match specified large multibyte character (eg |
515 \%U12345678) | 517 \%U12345678) |
792 Searching from the end of the file backwards is easier! | 794 Searching from the end of the file backwards is easier! |
793 | 795 |
794 */\%V* | 796 */\%V* |
795 \%V Match inside the Visual area. When Visual mode has already been | 797 \%V Match inside the Visual area. When Visual mode has already been |
796 stopped match in the area that |gv| would reselect. | 798 stopped match in the area that |gv| would reselect. |
797 Only works for the current buffer. | 799 This is a |/zero-width| match. To make sure the whole pattern is |
800 inside the Visual area put it at the start and end of the pattern, | |
801 e.g.: > | |
802 /\%Vfoo.*bar\%V | |
803 < Only works for the current buffer. | |
798 | 804 |
799 */\%#* *cursor-position* | 805 */\%#* *cursor-position* |
800 \%# Matches with the cursor position. Only works when matching in a | 806 \%# Matches with the cursor position. Only works when matching in a |
801 buffer displayed in a window. {not in Vi} | 807 buffer displayed in a window. {not in Vi} |
802 WARNING: When the cursor is moved after the pattern was used, the | 808 WARNING: When the cursor is moved after the pattern was used, the |
875 /\%>72v.* | 881 /\%>72v.* |
876 < When 'hlsearch' is set and you move the cursor around and make changes | 882 < When 'hlsearch' is set and you move the cursor around and make changes |
877 this will clearly show when the match is updated or not. | 883 this will clearly show when the match is updated or not. |
878 To match the text up to column 17: > | 884 To match the text up to column 17: > |
879 /.*\%17v | 885 /.*\%17v |
880 < Column 17 is not included, because that's where the "\%17v" matches, | 886 < Column 17 is included, because that's where the "\%17v" matches, |
881 and since this is a |/zero-width| match, column 17 isn't included in | 887 even though this is a |/zero-width| match. Adding a dot to match the |
882 the match. This does the same: > | 888 next character has the same result: > |
883 /.*\%<18v | 889 /.*\%17v. |
890 < This command does the same thing, but also matches when there is no | |
891 character in column 17: > | |
892 /.*\%<18v. | |
884 < | 893 < |
885 | 894 |
886 Character classes: {not in Vi} | 895 Character classes: {not in Vi} |
887 \i identifier character (see 'isident' option) */\i* | 896 \i identifier character (see 'isident' option) */\i* |
888 \I like "\i", but excluding digits */\I* | 897 \I like "\i", but excluding digits */\I* |