Ⅰ. 插件描述
Provides simple stirng encode/escape functionality inside vimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'roxma/vim-encode'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'roxma/vim-encode'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'roxma/vim-encode'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/roxma/vim-encode
Ⅳ. 文档说明
# Vim-encode
Description
Vim-encode provides simple stirng encode/escape functionality inside vim. It
helps make your life easier when you need to copy some text as string into your
code.
supported encode/escape type:
- html
- xml
- url
- hex
- cstring
- cstring_pretty
Usage
press <Leader>e the way you use vim's standard operators like d(delete)
Screencast here:
Key Mapping
If you don't want default mapping, add let g:vim_encode_default_mapping=0
into your vimrc. Use <Plug>(encode) for your own mapping.
If you want shorter keys for more specific encoding, html encode for example:
nnoremap <expr> <your_keys> encode#begin('html')
vnoremap <expr> <your_keys> encode#begin('html')How to Unencode?
Well, this feature is not yet implemented.
This plugin is for encoding pasted text for you code. You should keep the
original text as comment for readability or somewhere else anyway.
How to add my own encode type?
Call encode#add(type,handler), the hander here is a function that takes raw
string as parameter and return the encoded string.
