Ⅰ. 插件描述
Start async task for iterm2 in vimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'chemzqm/vim-iterm2-start'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'chemzqm/vim-iterm2-start'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'chemzqm/vim-iterm2-start'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/chemzqm/vim-iterm2-start
Ⅳ. 文档说明
# Vim-iterm2-start
Dispatch a task for iTerm2 in MacVim, used for async command line task (eg: git
push and unite tests)
It works much like vim-dispatch, the
difference is it's works (only) with MacVim, iTerm2 latest and fish shell, in
order to keep it quite simple. The reason I made this is I found changing the
code of vim-dispatch is quite hard, and it doesn't support iTerm2 > 2.9
Requirement:
- MacVim 7.3+
- iTerm2 > 2.9 currently in beta test (latest lightly build is preferred)
- fish shell (otherwise you will need change the code)
- Knowledge of command line tools
Update
- notification enabled, looks like:

Command
ItermStart[!] [options] {command}Start task in current session of iTerm2, when prefix with
!, not foucs the
iTerm window- -dir=... run command in given directory
- -title=... set label for iTerm2
- -no-wait disable the default prompt of
press enter to continueon
command error
ItermStartTab[!] [options] {command}Start task in a new tab session of iTerm2, options are the same as
ItermStartcommandNOTE: iTerm2 version > Build 2.9.20160103-nightly is required to make
iTerm2 run job at background corrently
Global varialbes
g:iterm_start_profileis used for control the profile used by
ItermStartTab, you can crate a profile of iTerm2 calledfishthat use fish shell, and
config ItermStartTab to use fish shell by add:
let g:iterm_start_profile = 'fish'
in your .vimrc
let g:iterm_start_enable=1would enable Mac notification on command success.
supportgrowlandterminal-notifier
Intergration
If you use vim-test, you can make your
test run in background by adding below lines to your .vimrc:
function! StartTest(cmd)
execute 'ItermStartTab! ' . a:cmd
endfunction
let g:test#custom_strategies = {'start': function('StartTest')}
let g:test#strategy = 'start'
Send message back to MacVim
You can make use of the vim feature clientserver to send message back to your
MacVim, here is a example of creating a filter program that parse output of
mocha and fill the quickfix of MacVim
https://gist.github.com/chemzqm/fd1313206c182884efbc
So you can jump to error location directly in your MacVim.
License
MIT