Skip to content

Instantly share code, notes, and snippets.

@rmueck
Last active April 24, 2019 05:31
Show Gist options
  • Save rmueck/adf651d2bdb1a54a55a215df8bed5e9f to your computer and use it in GitHub Desktop.
Save rmueck/adf651d2bdb1a54a55a215df8bed5e9f to your computer and use it in GitHub Desktop.
# Terminal
set -g default-terminal "screen-256color" # colors!
# History
set -g history-limit 10000
# Encoding
# set-option -g status-utf8 on
# set-option -g utf8 on
# set -g status-utf8 on
# set -g utf8 on
# Refresh rate of status bar
set -g status-interval 10
# replace C-b by C-a instead of using both prefixes
set -gu prefix2
unbind C-a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Position the status bar
set -g status-justify centre
set -g status-position bottom
# 0 is too far from ` ;)
set -g base-index 1
setw -g pane-base-index 1
# Automatically set window title OFF :)
set-window-option -g automatic-rename off
set-option -g set-titles off
set -g allow-rename off
set -g status-keys vi
setw -g mode-keys vi
setw -g monitor-activity off
bind-key _ split-window -h
bind-key - split-window -v
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key H resize-pane -L 5
bind-key L resize-pane -R 5
# Pane navigation with <ALT>-j/k/h/l
bind-key M-j resize-pane -D
bind-key M-k resize-pane -U
bind-key M-h resize-pane -L
bind-key M-l resize-pane -R
# Vim style pane selection with <prefix>
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Use Alt-vim keys without prefix key to switch panes
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Use Alt-arrow keys without prefix key to switch panes
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
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# No delay for escape key press
set -sg escape-time 0
# Edit configuration and reload
bind C-e new-window -n 'tmux.conf' "sh -c '\${EDITOR:-vim} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display \"Config reloaded\"'"
# Reload tmux config
bind C-r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
# Misc
# set -g status-bg black
# set -g status-fg white
# set -g window-status-current-bg white
# set -g window-status-current-fg black
# set -g window-status-current-attr bold
set -g status-left-length 30
set -g status-left '#[fg=red]#S'
# set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
set -g status-right '#[fg=red]%H:%M#[default]'
# set -g status-right ''
if '[ -f ~/tmux-colors-sola.conf ]' 'source ~/tmux-colors-sola.conf'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment