Skip to content

Instantly share code, notes, and snippets.

@chussenot
Created June 23, 2017 12:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chussenot/0d0ad95dcbeee93a76b7c56b7ca60570 to your computer and use it in GitHub Desktop.
Save chussenot/0d0ad95dcbeee93a76b7c56b7ca60570 to your computer and use it in GitHub Desktop.
# General options
set -g default-terminal "xterm-256color"
# Ring the bell if any background window rang a bell
set -g bell-action any
# Watch for activity in background windows
setw -g monitor-activity on
# pass through xterm keys
set -g xterm-keys on
# Keep your finger on ctrl, or don't, same result
bind-key ^D detach-client
bind-key ^C new-window
# Use vi keybindings in copy and choice modes
setw -g mode-keys vi
# Reload tmux config
# bind r source-file ~/.tmux.conf; display "Reloaded"
# pane border
set-option -g pane-active-border-fg black
set-option -g pane-active-border-bg default
set-option -g pane-border-fg brightcyan
set-option -g pane-border-bg default
# message text
set-option -g message-bg colour231 #base2
set-option -g message-fg colour196 #orange
# pane number display
set-option -g display-panes-active-colour colour20 #blue
set-option -g display-panes-colour colour196 #orange
# clock
set-window-option -g clock-mode-colour colour40 #green
# Count windows and panes from 1
set -g base-index 1
setw -g pane-base-index 1
# Setting the prefix from C-b to C-a
set -g prefix C-a
bind a send-prefix
# Free the original Ctrl-b prefix keybinding
unbind C-b
# Window management / navigation
# move between windows
bind-key ^N next-window
bind-key ^P previous-window
# Horizontal splits with s or ^S
unbind s
unbind ^S
bind-key s split-window
bind-key ^S split-window
# Vertical split with v or ^V
unbind v
unbind ^V
bind-key v split-window -h
bind-key ^V split-window -h
# Other
set -g mouse on
set -g history-limit 10000
# Window management / navigation
# move between windows
bind-key ^N next-window
bind-key ^P previous-window
# ^\ (no prefix) to skip to last window we were in before this one
bind -n "^\\" last-window
# Pane resize in all four directions using vi bindings.
# Can use these raw but I map them to Cmd-Opt-<h,j,k,l> in iTerm2.
# http://tangledhelix.com/blog/2012/04/28/iterm2-keymaps-for-tmux/
# Note on a few prefix options: ^A = 0x01, ^B = 0x02, ^G = 0x06
bind-key J resize-pane -D
bind-key K resize-pane -U
bind-key H resize-pane -L
bind-key L resize-pane -R
# switch panes using Alt-arrow without prefix
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
# don't rename windows automatically
set-option -g allow-rename off
# set Zsh as your default Tmux shell
set-option -g default-shell /bin/zsh
######
# THEME
set -g window-status-current-bg white
set -g window-status-current-fg black
set -g window-status-current-attr bold
set -g status-fg colour231
set -g status-bg colour234
set -g status-left "#[fg=green] #(~/.tmux-left)"
set -g status-left-length 30
set -g status-right '#(eval ~/.tmux-airline `tmux display -p "#{client_width}"`) | Batt: #{battery_percentage} - #{battery_remain} | CPU:#{cpu_percentage}'
set -g status-right-length 150
set -g status-interval 1
#####
if-shell 'test "$(uname)" = "Darwin"' 'source ~/.tmux-osx.conf'
#####
# Tmux plugins manager
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Continuum
set -g @continuum-restore
run '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment