Ⅰ. 插件描述
A utility Vim plugin used by some of my Vim plugins.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'coot/crdispatcher-all-too-well'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'coot/crdispatcher-all-too-well'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'coot/crdispatcher-all-too-well'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/coot/crdispatcher
Ⅳ. 文档说明
# CRDispatcher Vim Plugin
This is a utility plugin which is used in my other Vim plugins. It allows
registering callback functions which transform the command line after hitting
enter: for example EnchantedVim is using it to add \v to patterns.
It also has a nice hack to make c_CTRL-F work nicely: it will transform
the line when entering the command line. The crdispatcher#CRDsiaptcher dict
which is passed to callbacks has ctrl_f entry which is 1 in this case.
This is useful if a callback should only be used with <CR> or c_CTRL-F.
The plugins that depend on it are:
Callbacks
Every callback function accepts one argument: the crdispatcher#CRDispatcher
dictionary, and it can modify the cmdline value. A callback can also be
a dictionary with a dict function __transform_cmd__. You can copy thecrdispatcher#CallbackClass and use its __init__ method. For more
examples look at EnchantedVim.
Note
You can use the expression register with Vim 7.3.686 or later. With an
earlier version you will not be able to use it.
Code
This plugin is a simple example of OO programing in VimL.
- Copyright: © Marcin Szamotulski, 2014
- License: vim-license, see
:help license