Skip to content

Instantly share code, notes, and snippets.

@brevity
Last active December 27, 2015 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brevity/7252004 to your computer and use it in GitHub Desktop.
Save brevity/7252004 to your computer and use it in GitHub Desktop.
#
#bind S source-file ~/.tmux/session1
#bind s source-file ~/.tmux/session2
# improve colors
set -g default-terminal 'screen-16color'
# renumber windows sequentially after closing any of them
# set -g renumber-windows on
# smart pane switching with awareness of vim splits
#
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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment