From 7b698e2686988e81fc2db63de4b460788e09c5d6 Mon Sep 17 00:00:00 2001 From: Jacob Zimmerman Date: Wed, 25 Feb 2015 04:26:08 -0500 Subject: [PATCH] Plugin vim-tmux-navigator Even if you don't use tmux (a command line program for managing multiple terminal windows), this is a handy plugin to have. It lets you move around through splits (like the ones that get created by NERDTree and tagbar) using the shortcuts ^ | <-- C-h C-j C-k C-l --> | v However, it's even more powerful when combined with tmux, because it lets you switch between Vim splits and tmux panges with the same combos if you add the following snippet to your ~/.tmux.conf file: # See: https://github.com/christoomey/vim-tmux-navigator # Smart pane switching with awareness of Vim splits. is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" # restore overwritten C-l binding (clear screen) bind-key -n C-l send-keys 'C-l' ------------------------------------------------------------------------ tmux is a pretty great program. If you're looking for some resources to get you started: - https://jez.io/talks/tmux-and-other-tools/ - https://gist.github.com/MohamedAlaa/2961058 Tmux is also as configurable as Vim. If you'd like to take a look at a (rather elaborate) tmux.conf, here's mine: - https://github.com/jez/dotfiles/blob/d540b50/config/tmux/tmux.conf --- vimrc.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/vimrc.vim b/vimrc.vim index 18fdad3..3ed7913 100644 --- a/vimrc.vim +++ b/vimrc.vim @@ -33,6 +33,7 @@ Plugin 'Raimondi/delimitMate' " ----- man pages, tmux ----------------------------------------------- Plugin 'jez/vim-superman' +Plugin 'christoomey/vim-tmux-navigator' call vundle#end()