Ⅰ. 插件描述
Give detailed help on a given regexp pattern.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/explainpattern'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/explainpattern'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/explainpattern'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/ExplainPattern
Ⅳ. 文档说明
Continued here: https://github.com/Houl/ExplainPattern-vim (2017 Aug 06)
:ExplainPattern {pattern} or
:ExplainPattern {register}
parse the given Vim {pattern} and print a line of help
(with color) for each found pattern item. Nested
items get extra indent.
A single-char argument is used as {register} argument:
/ explain the last search pattern
* explain pattern from the clipboard
a explain pattern from register a
Example: :ExplainPattern *
Register: *
Pattern: C^%(\%(@<.|%[dxouU[(^$V#<>]\=\|z[1-9se(]\|@[>=!]\|_[[^$.]=|.)|.)
C match case while matching the pattern
^ match at start of line (or string)
%( start of non-capturing group
| \ literal string (1 atom(s))
| %( start of non-capturing group
| | @< literal string (2 atom(s))
| | . match any character
| | | OR branch
| | % literal string (1 atom(s))
| | [dxouU[(^$V#<>] collection
| | = (multi) zero or one of the preceding atom
| | | OR branch
| | z literal string (1 atom(s))
| | [1-9se(] collection
| | | OR branch
| | @ literal string (1 atom(s))
| | [>=!] collection
| | | OR branch
| | _ literal string (1 atom(s))
| | [1 collection
| | = (multi) zero or one of the preceding atom
| | | OR branch
| | . match any character
| ) end of group
| | OR branch
| . match any character
) end of group
2013 Jan 17
- $. ↩