Skip to content

Instantly share code, notes, and snippets.

@BrianHicks
Created October 9, 2015 20:01
Show Gist options
  • Save BrianHicks/b6bf781ace01b2322b90 to your computer and use it in GitHub Desktop.
Save BrianHicks/b6bf781ace01b2322b90 to your computer and use it in GitHub Desktop.
# vim: ft=conf:
set -g default-terminal "screen-256color"
set-option -g xterm-keys on
#### OPTIONS
# c-a instead of c-b
unbind C-b
unbind l
set -g prefix C-a
bind-key C-a last-pane
bind-key a send-prefix
# start numbering from 1 instead of 0
set -g base-index 1
set -s escape-time 1
# layouts
bind v select-layout main-vertical # c-a v to get a nice split view for vim + a terminal
# session management
bind S command-prompt -p "Make/attach session:" "new-window 'tmuxstart \'%%\''"
# walkabout
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# synchronization
bind e setw synchronize-panes on
bind E setw synchronize-panes off
# Options from Mark Volkmann's config
setw -g aggressive-resize on
setw -g mode-keys vi
# remember where I am when I split/create new windows grumble grumble
# note: the quotes here (except for ") are not necessary but it's nicer if they
# line up.
bind "%" split-window -h -c "#{pane_current_path}"
bind "|" split-window -h -c "#{pane_current_path}" # in addition to %
bind '"' split-window -v -c "#{pane_current_path}"
bind "-" split-window -v -c "#{pane_current_path}" # in addition to "
bind "c" new-window -c "#{pane_current_path}"
# reload .tmux.conf file with c-a r
bind r source-file ~/.tmux.conf \; display "reloaded"
# powerline
set -g status on
set -g status-utf8 on
set -g status-interval 2
set -g status-fg colour231
set -g status-bg colour234
set -g status-left-length 20
set -g status-left '#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour243,nobold]'
set -g status-right '#(date "+%l:%M%p" | sed "s/ / /") | #(sysctl -n vm.loadavg | cut -d " " -f 2-4)'
set -g status-right-length 150
set -g window-status-format "#[fg=colour244,bg=colour234] #I #[fg=colour240]#[fg=colour249]#W "
set -g window-status-current-format "#[fg=colour234,bg=colour31]#[fg=colour117,bg=colour31] #I #[fg=colour231,bold]#W #[fg=colour31,bg=colour234,nobold]"
# vim-tmux-navigator
# Smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l"
bind C-l send-keys 'C-l' # restore clearing the screen - this means c-a c-l
#### COLOR
# default statusbar colors
set-option -g status-fg colour245 #brcyan
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244
set-window-option -g window-status-bg default
set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg colour230 #orange
set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright
# pane border
set-option -g pane-border-fg colour235 #base02
set-option -g pane-active-border-fg colour240 #base01
# message text
set-option -g message-bg colour235 #base02
set-option -g message-fg colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour colour68 #green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment