4

GitHub - melonmanchan/vim-tmux-resizer: Resize tmux panes and vim splits with sa...

 4 years ago
source link: https://github.com/melonmanchan/vim-tmux-resizer
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

Vim Tmux Resizer

Resize tmux panes and vim splits with Alt + hjkl! Plays well with vim-tmux-navigator.

Installation

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>

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK