Ⅰ. 插件描述
a Vim Regular Expressions playgroundⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'daniellesucher/virex'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'daniellesucher/virex'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'daniellesucher/virex'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/daniellesucher/virex
Ⅳ. 文档说明
#Virex: a Vim Regular Expressions playground
Inspired by Rubular, this is a single-page app that offers a playground to experiment with Vim's regular expressions on the web.
Moving parts
The web app is written in Erlang, using webmachine. It sends the user-input test string and regex pattern to vim directly and uses vim's :%s/pattern/replacement/g substitution under the hood to highlight matches and separate out match groups.
Building and running locally
Make sure you have vim installed and then run:
make./start.sh
NGINX
Use this config if you want to use NGINX to serve the static content, acting as a reverse proxy to /regex API.
server {
listen 80;
server_name www.server_name.com;
access_log /var/log/nginx/server_name.com.access.log main;
root /YOUR_PATH_OF_INSTALLATION/virex/priv/www/;
location /regex {
proxy_pass http://127.0.0.1:8191;
}
}
Running on the server
VIREX_START_OPTIONS="-detached" ./start.sh