Skip to content

Instantly share code, notes, and snippets.

@pdehlke
Created January 16, 2015 17:37
Show Gist options
  • Save pdehlke/f19fa945a6c60109ca3d to your computer and use it in GitHub Desktop.
Save pdehlke/f19fa945a6c60109ca3d to your computer and use it in GitHub Desktop.
tmux.conf.user
set -g status-right "#h %d %b %Y :: %l:%M %p"
# Keep my window names
setw -g automatic-rename off
# integrate the mouse. We can click on panes, and drag to resize.
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
setw -g aggressive-resize on
# seamlessly move around splits, whether we're in vim or not.
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"
# copy/paste support
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment