diff options
Diffstat (limited to 'configs/.tmux.conf')
-rw-r--r-- | configs/.tmux.conf | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/configs/.tmux.conf b/configs/.tmux.conf index 1a7918444b82..190ab2cb3f99 100644 --- a/configs/.tmux.conf +++ b/configs/.tmux.conf @@ -105,15 +105,6 @@ bind '"' split-window -c "#{pane_current_path}" bind % split-window -h -c "#{pane_current_path}" bind c new-window -c "#{pane_current_path}" - -# Smart pane switching with awareness of vim splits -is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"' -bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" -bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" -bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" -bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" -bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" - # source '/usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf' bind-key h set -g status @@ -126,3 +117,13 @@ set-option -g status-left-length 60 set-option -g status-right-length 90 # set-option -g status-left "#(~/dotfiles/tmux-powerline/powerline.sh left)" # set-option -g status-right "#(~/dotfiles/tmux-powerline/powerline.sh right)" + + +# Bindings for "christoomey/vim-tmux-navigator" +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" |