Ⅰ. 插件描述
savemap is the library to provide a way to restore current mapping(s)/abbreviation(s) "perfectly".Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'tyru/savemap-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'tyru/savemap-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'tyru/savemap-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/tyru/savemap.vim
Ⅳ. 文档说明
|savemap| is the library to provide a way
to restore current mapping(s)/abbreviation(s) "perfectly".
...But remember, you can always use |:map-<buffer>| for "simple" case.
nmap foo blahblahblah let foo_nmap = savemap#save_map('n', 'foo') if empty(foo_nmap) echoerr 'your vim version is lower than 7.3.032!' endif nmap foo bar " Execute 'bar'. normal foo call foo_nmap.restore() " Execute 'blahblahblah'. normal foo
Omit 2nd arg of |savemap#save_map()| to save all mappings of the mode.
let normal_mappings = savemap#save_map('n') if empty(normal_mappings) echoerr 'your vim version is lower than 7.3.032!' endif
" Clear!
nmapclear
" Map own mappings.
nnoremap a b
nnoremap c d
...
try
... " Do it
finally
call normal_mappings.restore()
endtry
See doc/savemap.txt or :help savemap for more details.