Ⅰ. 插件描述
`open .` for Vim/TmuxⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'kevinlitchfield/open-tmux-pane-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'kevinlitchfield/open-tmux-pane-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'kevinlitchfield/open-tmux-pane-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/kevinlitchfield/open-tmux-pane.vim
Ⅳ. 文档说明
# open-tmux-pane.vim
This plugin exposes a single Vim script command, :OpenTmuxPane, that opens vertical or horizontal Tmux panes at the current file's directory or the Vim session's working directory. It's a sort of Vim/Tmux equivalent to OS X's open ..
Run with no arguments, just :OpenTmuxPane, it defaults to opening a vertical pane at the currently active file's directory.
:OpenTmuxPane can also be passed arguments: :OpenTmuxPane <direction> <directory>. Allowed values for <direction> are Horizontal/H/h and Vertical/V/v; allowed values for <directory> are CurrentFileDirectory and WorkingDirectory.
If you use the command frequently, some mappings might be useful, for example:
map <leader>% :OpenTmuxPane<CR>
map <leader>" :OpenTmuxPane Horizontal CurrentFileDirectory<CR>
map <leader>g% :OpenTmuxPane Vertical WorkingDirectory<CR>
map <leader>g" :OpenTmuxPane Vertical WorkingDirectory<CR>Configuration
If desired, you can set g:vertical_tmux_pane_size and g:horizontal_tmux_pane_size in your .vimrc to control the size of Tmux panes opened with open-tmux-pane.vim. For example:
let g:vertical_tmux_pane_size = '20'
let g:horizontal_tmux_pane_size = '190'There is no need to set these variables if you are happy with the default pane sizes.