Skip to content

Instantly share code, notes, and snippets.

@alexcrichton
Created March 4, 2019 21:14
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 alexcrichton/9d23fb131356ca096b3945bc612ac26d to your computer and use it in GitHub Desktop.
Save alexcrichton/9d23fb131356ca096b3945bc612ac26d to your computer and use it in GitHub Desktop.
################################################################################
# Key Bindings
################################################################################
unbind C-b # unbind default prefix
set -g prefix C-s # make the new prefix control+s
bind -n C-k clear-history # Just a raw control+k clears history (like apple+k)
bind-key s send-prefix # Allow nested sessions by an extra key stroke
unbind C-o # rotates panes, but accidentally hit too often (o in vim)
unbind u # hit too often (undoing vim changes)
unbind U # same as above
unbind { # equivalent is bound as <
unbind } # equivalent is bound as >
bind-key -r < swap-pane -U # { and } are tab-switch in vim, not for tmux
bind-key -r > swap-pane -D
unbind % # default window splitters are bad
set-window-option -g mode-keys vi
#bind-key -t emacs-copy C-b page-up
#bind-key -t emacs-copy C-f page-down
bind-key - split-window -v -c '#{pane_current_path}'
bind-key \ split-window -h -c '#{pane_current_path}'
# bind-key c neww -c '#{pane_current_path}'
# Pre-1.9 commands
#
#bind-key - split-window -v
#bind-key \ split-window -h
#
bind-key c neww
#set-option default-path "$PWD"
# Use control+shift+arrow key to resize panes
bind-key -n C-S-Up resize-pane -U 5
bind-key -n C-S-Left resize-pane -L 5
bind-key -n C-S-Right resize-pane -R 5
bind-key -n C-S-Down resize-pane -D 5
# On the OSX terminal, the M-Left and M-Right keys don't work by default for
# some reason, so the key codes for these two had to be added:
# \033\033[D (left) and \033\033[C (right)
################################################################################
# UI
################################################################################
# status bar changes
set -g status-bg colour18
set -g status-fg white
set -g status-left '#[fg=colour142] #S |'
set -g status-right "#[fg=green]| #(hostname -s) | #(loadavg) "
set-window-option -g window-status-current-bg red # highlight on status bar
set -g visual-activity on # notifications, not audible
set -g pane-active-border-bg green # highlight active pane border
set -g pane-active-border-fg green # highlight active pane border
set -g default-terminal "screen-256color" # tell vim we support 256color
set -g set-titles on
set -g set-titles-string '#h'
# Help SSH out by figuring out where the agent is. It is assume that .ssh/rc
# links $SSH_AUTH_SOCK to ~/.ssh/ssh_auth_sock and then the shell will condition
# if we're in ssh (SSH_CONNECTION) and export that to SSH_AUTH_SOCKS
#set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment