Ⅰ. 插件描述
An easy way to escape HTML entities.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'amadeus/vim-escaper'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'amadeus/vim-escaper'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'amadeus/vim-escaper'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/amadeus/vim-escaper
Ⅳ. 文档说明
# Escaper
A quick and easy plugin to escape html entities in Vim. It's smart enough to
not replace previously escaped entities.
Installation
It's recommended you use Pathogen, Vundle or NeoBundle. Otherwise copy the
respective files into their respective .vim sub folders.
How To Use
There are 2 APIs. Both can be called by themselves (to replace the entire
file), with a range, or a visual selection.
:Entities
This command is safe for use in html files. It will not escape <, >, '
and " characters.
:EntitiesAll
This command will replace ALL entities.
Ignore Arguments
If there are specific entities you'd like to ignore simply add them as
arguments to your function calls. Each argument should be separated by a
- These arguments can be passed into both commands above.
For example, this command would replace all entities except > and ":
:EntitiesAll > "Custom Replacements
You can also provide custom replacements list if you'd like. Since these are
called first, it enables the default replacements to be overridden.
Simply provide a global list of replacements like so:
let g:CustomEntities = [
\ ["£", "\£"],
\ ["¤", "\¤"]
\ ]Note: Ensure you escape the & with a \ as seen above.
License
Copyright © 2014 Amadeus Demarzi