Ⅰ. 插件描述
MakeⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'mikker/vim-rerunner'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'mikker/vim-rerunner'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'mikker/vim-rerunner'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/mikker/vim-rerunner
Ⅳ. 文档说明
# vim-rerunner
A plugin for vim that lets you easily map commands to <cr>.
Seems trivial. It is.
Why?
<cr> is kind of useless in Normal mode so I usually map it to do some command. Typically it's running a specific test but sometimes it's reloading Chrome. While writing this README it was w !markdown.pl. It could be anything.
How?
:Rerun !rspec spec saves the command !rspec spec away. Press <cr> to run it.
Obviously you could tie it to something fancier like [Dispatch.vim][] or the like.
:Rerun Dispatch
The idea is to make it easy to make it do whatever you're doing the most right now.
I have project specific .vimrcs in most of my projects looking more or less like this:
" silently run AppleScript that updates chrome
noremap <leader>rc :silent Rerun call system('reload-chrome')<cr>
" mark the current file
noremap <leader>rf :silent Rerun !rspec <c-r>=expand('%')<cr><cr>
" mark the current file and line
noremap <leader>rl :silent Rerun !rspec <c-r>=expand('%').':'.line('.')<cr><cr>It's really up to you.