diff tmux.conf @ 189:925861e874ec

Add vim-tmux-navigator for seamless navigation
author zegervdv <zegervdv@me.com>
date Sat, 08 Nov 2014 19:22:00 +0100
parents 1ec3c51c9047
children 4a74a83e6e36
line wrap: on
line diff
--- a/tmux.conf	Sat Nov 08 19:01:14 2014 +0100
+++ b/tmux.conf	Sat Nov 08 19:22:00 2014 +0100
@@ -11,13 +11,20 @@
 set -g status-keys vi
 # bind-key -t vi-edit Up
 # bind-key -t vi-eidt Down
-bind h select-pane -L
-bind j select-pane -D
-bind k select-pane -U
-bind l select-pane -R
+# bind h select-pane -L
+# bind j select-pane -D
+# bind k select-pane -U
+# bind l select-pane -R
 bind-key -r C-h select-window -t :-
 bind-key -r C-l select-window -t :+
 
+# Move between tmux and vim seamlessly
+bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
+bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
+bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
+bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
+bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
+
 #act like GNU screen
 unbind C-b
 set -g prefix C-a