Skip to content

Instantly share code, notes, and snippets.

@jpaton
Created January 20, 2017 00:36
Show Gist options
  • Save jpaton/521be6489d51d51cef8944fdf7d5e2ce to your computer and use it in GitHub Desktop.
Save jpaton/521be6489d51d51cef8944fdf7d5e2ce to your computer and use it in GitHub Desktop.
unbind C-b
set -g prefix C-z
bind C-z send-prefix
# Smart pane switching with awareness of vim splits
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment