annotate runtime/doc/pi_logipat.txt @ 14572:7bf554378133

Added tag v8.1.0299 for changeset 44df6e5c17c3a3771089efc3e4c2da0b3cc340b5
author Christian Brabandt <cb@256bit.org>
date Sun, 19 Aug 2018 17:15:06 +0200
parents 2f7e67dd088c
children 70ce979e76bc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 :LogiPatFlags {search flags}
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45 LogiPat uses the |search()| command. The flags
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46 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
47 by the :LogiPatFlags command.
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
48
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
49 :LPF {search flags} *:LPF*
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50 :LPF is a shorthand version of :LogiPatFlags.
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52 :let pat=LogiPat({boolean-logic pattern}) *LogiPat()*
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 If one calls LogiPat() directly, no search
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54 is done, but the transformation from the boolean
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
55 logic pattern into a regular expression pattern
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
56 is performed and returned.
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
57
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58 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
59 the pattern, double it.
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60
8876
47f17f66da3d commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents: 6855
diff changeset
61
6855
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
62 ==============================================================================
8876
47f17f66da3d commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents: 6855
diff changeset
63 3. LogiPat Examples *logiPat-examples*
6855
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
64
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
65 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
66 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
67 follows:
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
68 >
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
69 :LogiPat "abc"
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
70 < will search for lines containing the string :abc:
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
71 >
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
72 :LogiPat "ab""cd"
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
73 < 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
74 >
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
75 :LogiPat !"abc"
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
76 < 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
77 >
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
78 :LogiPat "abc"|"def"
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
79 < 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
80 :abc: or the string :def:
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
81 >
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
82 :LogiPat !("abc"|"def")
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
83 < 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
84 of the strings :abc: or :def:
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
85 >
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
86 :LogiPat "abc"&"def"
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
87 < 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
88 :abc: and :def:
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
89 >
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
90 :let pat= LogiPat('!"abc"')
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
91 < will return the regular expression which will match
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
92 all lines not containing :abc: . The double quotes
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
93 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
94 differentiate such patterns from boolean logic
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
95 operators.
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
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
98 ==============================================================================
8876
47f17f66da3d commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents: 6855
diff changeset
99 4. Caveat *logiPat-caveat*
6855
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
100
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
101 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
102 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
103 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
104 is what you want.
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
105
8876
47f17f66da3d commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents: 6855
diff changeset
106
6855
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
107 ==============================================================================
8876
47f17f66da3d commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents: 6855
diff changeset
108 3. LogiPat History *logiPat-history*
6855
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
109
8876
47f17f66da3d commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents: 6855
diff changeset
110 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
111 plugin distribution; hence the name change
6855
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
112 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
113 in \%(...\) parentheses
8876
47f17f66da3d commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents: 6855
diff changeset
114 Dec 12, 2011 * |:LPE| added
6855
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
115 * "" 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
116 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
117 v1 May 23, 2005 * initial release
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
118
8876
47f17f66da3d commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents: 6855
diff changeset
119
6855
ee45d3b0579b Add the logiPat plugin to the distribution.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
120 ==============================================================================
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10498
diff changeset
121 vim:tw=78:ts=8:noet:ft=help