Skip to content

Instantly share code, notes, and snippets.

@dcwangmit01
Created April 19, 2018 16:58
Show Gist options
  • Save dcwangmit01/308a2e43da8fa57258add9c96847f67d to your computer and use it in GitHub Desktop.
Save dcwangmit01/308a2e43da8fa57258add9c96847f67d to your computer and use it in GitHub Desktop.
20180419 tmux.conf
# Set the terminal type so colors get rendered correctly
set -g default-terminal "screen-256color"
# window numbering
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set-window-option -g pane-base-index 1
set -g renumber-windows on
# increase scrollback lines
set -g history-limit 10000
# Mouse Mode
set-option -g mouse on
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# pane navigation
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# pane resizing
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# set terminal title
set -g set-titles on
set -g set-titles-string '#h ❐ #S ● #I #W'
# set window title to be last 3 segments of path
# highlight active window
# variation of: https://stackoverflow.com/questions/28376611/how-to-automatically-rename-tmux-windows-to-the-current-directory
set-window-option -g window-status-current-format '#[fg=red,bg=colour166,bold] #{window_index} #[fg=green]#{pane_current_command} #[fg=cyan]#(echo "#{pane_current_path}" | rev | cut -d'/' -f-3 | rev) #[fg=white]|'
set-window-option -g window-status-format '#[fg=white,bold]#{window_index} #[fg=green]#{pane_current_command} #[fg=blue]#(echo "#{pane_current_path}" | rev | cut -d'/' -f-3 | rev) #[fg=white]|'
###############################################################################
# Solarized (cut and pasted)
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
#### COLOUR (Solarized 256)
# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
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 colour166 #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 colour64 #green
# bell
set-window-option -g window-status-bell-style fg=colour235,bg=colour160 #base02, red
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment