Ⅰ. 插件描述
Use Python-style PCRE instead of those weird vim regular expressions.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'mbr/vim-pyre'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'mbr/vim-pyre'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'mbr/vim-pyre'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/mbr/vim-pyre
Ⅳ. 文档说明
====================================================
Perl-style regular expressions in VIM through Python
A small vim plugin that adds a new command: :S. It works somewhat similiar
to the regular :s, but all regular expressions are split using a python
script and evaluated with Python's re-module.
Examples::
:%S/foo/bar/g " replaces 'foo' with 'bar' in the whole document
:S/hello, (w+)/goodbye 1 " replace strings like "hello bob" with
" "goodbye bob" on the current line:'<,'>S#[cK]orn#candy# " replaces all instances of "corn" and "Korn"
" with "candy"
Installation
To install, simply copy pyre.vim into your .vim/plugin folder. Or useVAM <https://github.com/MarcWeber/vim-addon-manager>_
Search
Currently, this only does substition, not matching. I rarely search using
regexes.