Mercurial > vim
annotate runtime/doc/pi_logipat.txt @ 18857:70ce979e76bc
Update a few runtime files.
Commit: https://github.com/vim/vim/commit/2ed639abdc4000436115f378e28320b7bee38a6e
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Dec 9 23:11:18 2019 +0100
Update a few runtime files.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 09 Dec 2019 23:15:04 +0100 |
parents | 2f7e67dd088c |
children | 1a951a4beee3 |
rev | line source |
---|---|
10498
883396809b45
commit https://github.com/vim/vim/commit/bc2eada5424bff06f7eb77c032ecc067da52b846
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
1 *pi_logipat.txt* Logical Patterns Jun 22, 2015 |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
2 |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
3 Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM> |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
4 Copyright: (c) 2004-2015 by Charles E. Campbell *logiPat-copyright* |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
5 The VIM LICENSE applies to LogiPat.vim and LogiPat.txt |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
6 (see |copyright|) except use "LogiPat" instead of "Vim" |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
7 No warranty, express or implied. Use At-Your-Own-Risk. |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
8 |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
9 ============================================================================== |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
10 1. Contents *logiPat* *logiPat-contents* |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
11 |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
12 1. Contents.................: |logiPat-contents| |
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
13 2. LogiPat Manual...........: |logiPat-manual| |
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
14 3. LogiPat Examples.........: |logiPat-examples| |
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
15 4. Caveat...................: |logiPat-caveat| |
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
16 5. LogiPat History..........: |logiPat-history| |
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
17 |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
18 |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
19 ============================================================================== |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
20 2. LogiPat Manual *logiPat-manual* *logiPat-man* |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
21 |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
22 *logiPat-arg* *logiPat-input* *logiPat-pattern* *logiPat-operators* |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
23 Boolean logic patterns are composed of |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
24 |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
25 operators ! = not |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
26 | = logical-or |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
27 & = logical-and |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
28 grouping ( ... ) |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
29 patterns "pattern" |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
30 |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
31 :LogiPat {boolean-logic pattern} *:LogiPat* |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
32 :LogiPat is a command which takes a boolean-logic |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
33 argument (|logiPat-arg|). |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
34 |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
35 :LP {boolean-logic pattern} *:LP* |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
36 :LP is a shorthand command version of :LogiPat |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
37 |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
38 :LPE {boolean-logic pattern} *:LPE* |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
39 No search is done, but the conversion from the |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
40 boolean logic pattern to the regular expression |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
41 is performed and echoed onto the display. |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
42 |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
43 :LogiPatFlags {search flags} *LogiPat-flags* |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
44 LogiPat uses the |search()| command. The flags |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
45 passed to that call to search() may be specified |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
46 by the :LogiPatFlags command. |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
47 |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
48 :LPF {search flags} *:LPF* |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
49 :LPF is a shorthand version of :LogiPatFlags. |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
50 |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
51 :let pat=LogiPat({boolean-logic pattern}) *LogiPat()* |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
52 If one calls LogiPat() directly, no search |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
53 is done, but the transformation from the boolean |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
54 logic pattern into a regular expression pattern |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
55 is performed and returned. |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
56 |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
57 To get a " inside a pattern, as opposed to having it delimit |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
58 the pattern, double it. |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
59 |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
60 |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
61 ============================================================================== |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
62 3. LogiPat Examples *logiPat-examples* |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
63 |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
64 LogiPat takes Boolean logic arguments and produces a regular |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
65 expression which implements the choices. A series of examples |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
66 follows: |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
67 > |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
68 :LogiPat "abc" |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
69 < will search for lines containing the string :abc: |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
70 > |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
71 :LogiPat "ab""cd" |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
72 < will search for lines containing the string :ab"c: |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
73 > |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
74 :LogiPat !"abc" |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
75 < will search for lines which don't contain the string :abc: |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
76 > |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
77 :LogiPat "abc"|"def" |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
78 < will search for lines which contain either the string |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
79 :abc: or the string :def: |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
80 > |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
81 :LogiPat !("abc"|"def") |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
82 < will search for lines which don't contain either |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
83 of the strings :abc: or :def: |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
84 > |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
85 :LogiPat "abc"&"def" |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
86 < will search for lines which contain both of the strings |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
87 :abc: and :def: |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
88 > |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
89 :let pat= LogiPat('!"abc"') |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
90 < will return the regular expression which will match |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
91 all lines not containing :abc: . The double quotes |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
92 are needed to pass normal patterns to LogiPat, and |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
93 differentiate such patterns from boolean logic |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
94 operators. |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
95 |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
96 |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
97 ============================================================================== |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
98 4. Caveat *logiPat-caveat* |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
99 |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
100 The "not" operator may be fragile; ie. it may not always play well |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
101 with the & (logical-and) and | (logical-or) operators. Please try out |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
102 your patterns, possibly with :set hls, to insure that what is matching |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
103 is what you want. |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
104 |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
105 |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
106 ============================================================================== |
18857
70ce979e76bc
Update a few runtime files.
Bram Moolenaar <Bram@vim.org>
parents:
14421
diff
changeset
|
107 5. LogiPat History *logiPat-history* |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
108 |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
109 v4 Jun 22, 2015 * LogiPat has been picked up by Bram M for standard |
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
110 plugin distribution; hence the name change |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
111 v3 Sep 25, 2006 * LP_Or() fixed; it now encapsulates its output |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
112 in \%(...\) parentheses |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
113 Dec 12, 2011 * |:LPE| added |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
114 * "" is mapped to a single " and left inside patterns |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
115 v2 May 31, 2005 * LPF and LogiPatFlags commands weren't working |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
116 v1 May 23, 2005 * initial release |
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
117 |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
6855
diff
changeset
|
118 |
6855
ee45d3b0579b
Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
119 ============================================================================== |
14421 | 120 vim:tw=78:ts=8:noet:ft=help |