Ⅰ. 插件描述
Vim plugin to run shell commands in an interactive shellⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'christoomey/vim-run-interactive'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'christoomey/vim-run-interactive'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'christoomey/vim-run-interactive'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/christoomey/vim-run-interactive
Ⅳ. 文档说明
Run Interactive
Run Interactive is a Vim plugin for selectively running commands via an
interactive shell. This allows you to take advantage of custom functions,
aliases, etc that are configured via your login shell scripts.
Vim supports treating the shell as an interactive shell, but this has
[performance and maintenance concerns][]. This plugin allows for temporarily
setting Vim to use an interactive shell, then returns to default
non-interactive configuration after executing the specified command.
It provides a single command, RunInInteractiveShell, which allows you to
run a command via an interactive shell. For instance, assume you have a
a git alias called update defined in your ~/.gitconfig. By default you
would not be able to run this command from within Vim, but with this plugin
you can run it via:
:RunInInteractiveShell git updateInstallation
Install with [Vundle][] by adding the following line to your vimrc:
Bundle 'christoomey/vim-run-interactive'And then run the :BundleInstall command from within Vim.
Usage
The main interface to the plugin is via the command, RunInInteractiveShell.
This is obviously a bit of a mouthful, so a mapping like the following is
recommended:
" Add this to your vimrc to provide a shortcut
nnoremap <leader>ri :RunInInteractiveShell<space>Assuming you are using , as you leader, then you can type ,ri in normal
mode and the command name will be populated for you along with a trailing
- You can then enter your desired shell command and hit
enterto run
it.