Skip to content

Instantly share code, notes, and snippets.

@thedouglenz
Created October 1, 2018 17:34
Show Gist options
  • Save thedouglenz/18fce8cde7f3bb38ac31d1f0c0a33c30 to your computer and use it in GitHub Desktop.
Save thedouglenz/18fce8cde7f3bb38ac31d1f0c0a33c30 to your computer and use it in GitHub Desktop.
.tmux.conf
# Change prefix key from CTRL-B (default) to CTRL-A
unbind C-b
set -g prefix C-a
# Quickly reload tmux configuration
bind r source-file ~/.tmux.conf
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Mouse can focus on a pane
set-option -g mouse-select-pane on
# Mouse can resize a pane
set-option -g mouse-resize-pane on
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind-key -t copy-mode-vi C-h select-pane -L
bind-key -t copy-mode-vi C-j select-pane -D
bind-key -t copy-mode-vi C-k select-pane -U
bind-key -t copy-mode-vi C-l select-pane -R
bind-key -t copy-mode-vi C-\ select-pane -l
# Better split panes commands | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
######################
## Tmux Look / Feel ##
######################
# modes
setw -g clock-mode-colour colour5
setw -g mode-attr bold
setw -g mode-fg colour1
setw -g mode-bg colour33
# panes
set -g pane-border-bg colour0
set -g pane-border-fg colour33
set -g pane-active-border-bg colour0
set -g pane-active-border-fg colour57
# statusbar
set -g status-position top
set -g status-justify left
set -g status-bg colour32
set -g status-fg colour137
#set -g status-attr dim
set -g status-left ''
set -g status-right '#[fg=colour15,bg=colour57,bold] %d/%m #[fg=colour15,bg=colour57,bold] %H:%M '
set -g status-right-length 50
set -g status-left-length 20
setw -g window-status-current-fg colour1
setw -g window-status-current-bg colour33
setw -g window-status-current-attr bold
setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F '
setw -g window-status-fg colour9
setw -g window-status-bg colour18
setw -g window-status-attr none
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
# messages
set -g message-attr bold
set -g message-fg colour232
set -g message-bg colour16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment