All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 *explainpat.txt* Give detailed help on a regexp pattern.
3 For Vim version 7.0. Last change: 2013 Mar 09
4 By Andy Wokula <anwoku@yahoo.de>
6 *explainpat* *explainpat.vim*
7 ExplainPat is a plugin to inspect a Vim regexp pattern and show a line of help
8 for each found regexp item.
10 If you find that it explains something wrong, please drop me an email.
12 URL http://vim.sourceforge.net/scripts/script.php?script_id=4364
13 ==============================================================================
15 :ExplainPattern {pattern}
16 :ExplainPattern {register}
17 inspect the given Vim {pattern} and print a line of
18 help (with color) for each found pattern item. Nested
19 items get extra indent.
21 A single-char argument is used as {register} argument:
22 / explain the last search pattern
23 * explain pattern from the clipboard
24 a explain pattern from register a
27 The pattern is first converted into a purely |magic| pattern using
28 |nwo#magic#MakeMagic()|. This means that embedded |/\V| |/\M| |/\m| |/\v|
29 specifiers are effectively removed from the explanation.
31 :ExplainPattern also accepts some invalid patterns: >
36 ==============================================================================
41 + wording: `\|' is not an "OR branch" (it separates or branches)
42 + NF added tests (not part of release)
43 + NF accept custom help printer (for testing purpose, could also be used to
47 + BF `[foo` is a literal string
48 + BF for |/star|, |/^| and |/$|, distinguish position in the pattern
49 (sometimes these become literal); special cases: `^**', `^^', `\c^^', `$$',
50 `a\|^b', `a\&*b', `[ab', `\_[ab', ...
53 + BF accept `\z(...\)` and `\z[N]`
54 + BF accept `[=a=]` and `[.a.]` in collections
57 + include vim_use suggestions [2012 Dec 19]
58 * for collections [^...], add "not matching [...]"
60 * more detailed `\%x31`
62 v0.1 (initial version)
63 + start of "first" capturing group, start of 2nd ...
64 + `\|' should get less indent than the branches, do we need to create an
65 AST? ! no, keep it straight forward
69 ==============================================================================
70 vim:tw=78:fo=tcq2:sts=0:ts=8:sw=8:fdm=marker:fmr=^_\^,^\^:ft=help: