Skip to content

Commit b537baf

Browse files
committed
Add pi_logipat.txt #126
1 parent 2521666 commit b537baf

File tree

4 files changed

+238
-2
lines changed

4 files changed

+238
-2
lines changed

doc/help.jax

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*help.txt* For Vim バージョン 7.4. Last change: 2015 Apr 15
1+
*help.txt* For Vim バージョン 7.4. Last change: 2015 Jun 21
22

33
VIM - メインヘルプファイル
44
k
@@ -197,6 +197,7 @@ GUI ~
197197
標準プラグイン ~
198198
|pi_getscript.txt| Vim スクリプトの最新版をダウンロードする
199199
|pi_gzip.txt| 圧縮ファイルの読み書き
200+
|pi_logipat.txt| パターンにおける論理演算子
200201
|pi_netrw.txt| ネットワークファイルの読み書き
201202
|pi_paren.txt| 対括弧の強調表示
202203
|pi_tar.txt| Tar ファイルエクスプローラ

doc/pi_logipat.jax

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
*pi_logipat.txt* 論理パターン Mar 13, 2013
2+
3+
Author: Charles E. Campbell <[email protected]>
4+
Copyright: (c) 2004-2013 by Charles E. Campbell *logipat-copyright*
5+
The VIM LICENSE applies to LogiPat.vim and LogiPat.txt
6+
(see |copyright|) except use "LogiPat" instead of "Vim"
7+
No warranty, express or implied. Use At-Your-Own-Risk.
8+
9+
==============================================================================
10+
1. 目次 *logipat* *logipat-contents*
11+
12+
1. 目次.....................: |logipat-contents|
13+
2. LogiPat マニュアル.......: |logipat-manual|
14+
3. LogiPat 使用例...........: |logipat-examples|
15+
4. 注意.....................: |logipat-caveat|
16+
5. LogiPat 変更履歴.........: |logipat-history|
17+
18+
==============================================================================
19+
2. LogiPat マニュアル *logipat-manual* *logipat-man*
20+
21+
22+
*logipat-arg* *logipat-input* *logipat-pattern* *logipat-operators*
23+
Boolean logic patterns are composed of
24+
25+
operators ! = not
26+
| = logical-or
27+
& = logical-and
28+
grouping ( ... )
29+
patterns "pattern"
30+
31+
:LogiPat {boolean-logic pattern} *:LogiPat*
32+
:LogiPat is a command which takes a boolean-logic
33+
argument (|logipat-arg|).
34+
35+
:LP {boolean-logic pattern} *:LP*
36+
:LP is a shorthand command version of :LogiPat
37+
(|:LogiPat|).
38+
39+
:ELP {boolean-logic pattern} *:ELP*
40+
No search is done, but the conversion from the
41+
boolean logic pattern to the regular expression
42+
is performed and echoed onto the display.
43+
44+
:LogiPatFlags {search flags} *LogiPat-flags*
45+
:LogiPatFlags {search flags}
46+
LogiPat uses the |search()| command. The flags
47+
passed to that call to search() may be specified
48+
by the :LogiPatFlags command.
49+
50+
:LPF {search flags} *:LPF*
51+
:LPF is a shorthand version of :LogiPatFlags.
52+
53+
:let pat=LogiPat({boolean-logic pattern}) *LogiPat()*
54+
If one calls LogiPat() directly, no search
55+
is done, but the transformation from the boolean
56+
logic pattern into a regular expression pattern
57+
is performed and returned.
58+
59+
To get a " inside a pattern, as opposed to having it delimit
60+
the pattern, double it.
61+
62+
==============================================================================
63+
3. LogiPat 使用例 *logipat-examples*
64+
65+
LogiPat takes Boolean logic arguments and produces a regular
66+
expression which implements the choices. A series of examples
67+
follows:
68+
>
69+
:LogiPat "abc"
70+
< will search for lines containing the string :abc:
71+
>
72+
:LogiPat "ab""cd"
73+
< will search for lines containing the string :ab"c:
74+
>
75+
:LogiPat !"abc"
76+
< will search for lines which don't contain the string :abc:
77+
>
78+
:LogiPat "abc"|"def"
79+
< will search for lines which contain either the string
80+
:abc: or the string :def:
81+
>
82+
:LogiPat !("abc"|"def")
83+
< will search for lines which don't contain either
84+
of the strings :abc: or :def:
85+
>
86+
:LogiPat "abc"&"def"
87+
< will search for lines which contain both of the strings
88+
:abc: and :def:
89+
>
90+
:let pat= LogiPat('!"abc"')
91+
< will return the regular expression which will match
92+
all lines not containing :abc: . The double quotes
93+
are needed to pass normal patterns to LogiPat, and
94+
differentiate such patterns from boolean logic
95+
operators.
96+
97+
98+
==============================================================================
99+
4. 注意 *logipat-caveat*
100+
101+
The "not" operator may be fragile; ie. it may not always play well
102+
with the & (logical-and) and | (logical-or) operators. Please try out
103+
your patterns, possibly with :set hls, to insure that what is matching
104+
is what you want.
105+
106+
==============================================================================
107+
5. LogiPat 変更履歴 *logipat-history*
108+
109+
v3 Sep 25, 2006 * LP_Or() fixed; it now encapsulates its output
110+
in \%(...\) parentheses
111+
Dec 12, 2011 * |:ELP| added
112+
* "" is mapped to a single " and left inside patterns
113+
v2 May 31, 2005 * LPF and LogiPatFlags commands weren't working
114+
v1 May 23, 2005 * initial release
115+
116+
==============================================================================
117+
vim:tw=78:ts=8:ft=help

en/help.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*help.txt* For Vim version 7.4. Last change: 2015 Apr 15
1+
*help.txt* For Vim version 7.4. Last change: 2015 Jun 21
22

33
VIM - main help file
44
k
@@ -197,6 +197,7 @@ Remarks about specific systems ~
197197
Standard plugins ~
198198
|pi_getscript.txt| Downloading latest version of Vim scripts
199199
|pi_gzip.txt| Reading and writing compressed files
200+
|pi_logipat.txt| Logical operators on patterns
200201
|pi_netrw.txt| Reading and writing files over a network
201202
|pi_paren.txt| Highlight matching parens
202203
|pi_tar.txt| Tar file explorer

en/pi_logipat.txt

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
*pi_logipat.txt* Logical Patterns Mar 13, 2013
2+
3+
Author: Charles E. Campbell <[email protected]>
4+
Copyright: (c) 2004-2013 by Charles E. Campbell *logipat-copyright*
5+
The VIM LICENSE applies to LogiPat.vim and LogiPat.txt
6+
(see |copyright|) except use "LogiPat" instead of "Vim"
7+
No warranty, express or implied. Use At-Your-Own-Risk.
8+
9+
==============================================================================
10+
1. Contents *logipat* *logipat-contents*
11+
12+
1. Contents.................: |logipat-contents|
13+
2. LogiPat Manual...........: |logipat-manual|
14+
3. LogiPat Examples.........: |logipat-examples|
15+
4. Caveat...................: |logipat-caveat|
16+
5. LogiPat History..........: |logipat-history|
17+
18+
==============================================================================
19+
2. LogiPat Manual *logipat-manual* *logipat-man*
20+
21+
22+
*logipat-arg* *logipat-input* *logipat-pattern* *logipat-operators*
23+
Boolean logic patterns are composed of
24+
25+
operators ! = not
26+
| = logical-or
27+
& = logical-and
28+
grouping ( ... )
29+
patterns "pattern"
30+
31+
:LogiPat {boolean-logic pattern} *:LogiPat*
32+
:LogiPat is a command which takes a boolean-logic
33+
argument (|logipat-arg|).
34+
35+
:LP {boolean-logic pattern} *:LP*
36+
:LP is a shorthand command version of :LogiPat
37+
(|:LogiPat|).
38+
39+
:ELP {boolean-logic pattern} *:ELP*
40+
No search is done, but the conversion from the
41+
boolean logic pattern to the regular expression
42+
is performed and echoed onto the display.
43+
44+
:LogiPatFlags {search flags} *LogiPat-flags*
45+
:LogiPatFlags {search flags}
46+
LogiPat uses the |search()| command. The flags
47+
passed to that call to search() may be specified
48+
by the :LogiPatFlags command.
49+
50+
:LPF {search flags} *:LPF*
51+
:LPF is a shorthand version of :LogiPatFlags.
52+
53+
:let pat=LogiPat({boolean-logic pattern}) *LogiPat()*
54+
If one calls LogiPat() directly, no search
55+
is done, but the transformation from the boolean
56+
logic pattern into a regular expression pattern
57+
is performed and returned.
58+
59+
To get a " inside a pattern, as opposed to having it delimit
60+
the pattern, double it.
61+
62+
==============================================================================
63+
3. LogiPat Examples *logipat-examples*
64+
65+
LogiPat takes Boolean logic arguments and produces a regular
66+
expression which implements the choices. A series of examples
67+
follows:
68+
>
69+
:LogiPat "abc"
70+
< will search for lines containing the string :abc:
71+
>
72+
:LogiPat "ab""cd"
73+
< will search for lines containing the string :ab"c:
74+
>
75+
:LogiPat !"abc"
76+
< will search for lines which don't contain the string :abc:
77+
>
78+
:LogiPat "abc"|"def"
79+
< will search for lines which contain either the string
80+
:abc: or the string :def:
81+
>
82+
:LogiPat !("abc"|"def")
83+
< will search for lines which don't contain either
84+
of the strings :abc: or :def:
85+
>
86+
:LogiPat "abc"&"def"
87+
< will search for lines which contain both of the strings
88+
:abc: and :def:
89+
>
90+
:let pat= LogiPat('!"abc"')
91+
< will return the regular expression which will match
92+
all lines not containing :abc: . The double quotes
93+
are needed to pass normal patterns to LogiPat, and
94+
differentiate such patterns from boolean logic
95+
operators.
96+
97+
98+
==============================================================================
99+
4. Caveat *logipat-caveat*
100+
101+
The "not" operator may be fragile; ie. it may not always play well
102+
with the & (logical-and) and | (logical-or) operators. Please try out
103+
your patterns, possibly with :set hls, to insure that what is matching
104+
is what you want.
105+
106+
==============================================================================
107+
3. LogiPat History *logipat-history*
108+
109+
v3 Sep 25, 2006 * LP_Or() fixed; it now encapsulates its output
110+
in \%(...\) parentheses
111+
Dec 12, 2011 * |:ELP| added
112+
* "" is mapped to a single " and left inside patterns
113+
v2 May 31, 2005 * LPF and LogiPatFlags commands weren't working
114+
v1 May 23, 2005 * initial release
115+
116+
==============================================================================
117+
vim:tw=78:ts=8:ft=help

0 commit comments

Comments
 (0)