Skip to content

Instantly share code, notes, and snippets.

@tinyheero
Last active August 29, 2015 14:23
Show Gist options
  • Save tinyheero/95ba21602ace0e234ca2 to your computer and use it in GitHub Desktop.
Save tinyheero/95ba21602ace0e234ca2 to your computer and use it in GitHub Desktop.
My ~/.tmux.conf file
# Set the prefix to be "ctrl+a"
unbind C-b
set -g prefix C-a
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Allows last active window to be brought up with C-a C-a
bind-key C-a last-window
set -g base-index 1 # Starts the naming of windows at 1
set -g status on
set-window-option -g mode-keys vi
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
# Smart pane switching with awareness of vim splits
# recommended by vim plugin vim-tmux-navigator
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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment