Ⅰ. 插件描述
Resize tmux panes and vim splits with same shortcutsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'melonmanchan/vim-tmux-resizer'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'melonmanchan/vim-tmux-resizer'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'melonmanchan/vim-tmux-resizer'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/melonmanchan/vim-tmux-resizer
Ⅳ. 文档说明
# Vim Tmux Resizer
Resize tmux panes and vim splits with Alt + hjkl! Plays well with vim-tmux-navigator.
Installation
Tmux
Add the following lines to your .tmux.conf file
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n M-h if-shell "$is_vim" "send-keys M-h" "resize-pane -L 10"
bind -n M-l if-shell "$is_vim" "send-keys M-l" "resize-pane -R 10"
bind -n M-k if-shell "$is_vim" "send-keys M-k" "resize-pane -U 5"
bind -n M-j if-shell "$is_vim" "send-keys M-j" "resize-pane -D 5"Configuration
Custom bindings
If you'd prefer to use your own shortcuts instead of the alt keys and Vim movement,
add the following to your .vimrc, changing mappings as needed!
let g:tmux_resizer_no_mappings = 1
nnoremap <silent> {Left-mapping} :TmuxResizeLeft<cr>
nnoremap <silent> {Down-Mapping} :TmuxResizeDown<cr>
nnoremap <silent> {Up-Mapping} :TmuxResizeUp<cr>
nnoremap <silent> {Right-Mapping} :TmuxResizeRight<cr>