Skip to content

Instantly share code, notes, and snippets.

@chussenot
Created January 12, 2017 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chussenot/dcbe5a009b1aa04c264f5f9e09df5215 to your computer and use it in GitHub Desktop.
Save chussenot/dcbe5a009b1aa04c264f5f9e09df5215 to your computer and use it in GitHub Desktop.
# Our .tmux.conf file
# Setting the prefix from C-b to C-a
# START:prefix
set -g prefix C-a
bind a send-prefix
# END:prefix
# Free the original Ctrl-b prefix keybinding
# START:unbind
unbind C-b
# END:unbind
###########################################################################
# General options
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal screen-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
# scrollback size
set -g history-limit 10000
# set first window to index 1 (not 0) to map more to the keyboard layout
# set -g base-index 1
# setw -g pane-base-index 1
# pass through xterm keys
set -g xterm-keys on
###########################################################################
# General keymap
# Keep your finger on ctrl, or don't, same result
bind-key ^D detach-client
bind-key ^C new-window
# Redraw the client (if interrupted by wall, etc)
bind R refresh-client
# reload tmux config
unbind r
bind r \
source-file ~/.tmux.conf \;\
display 'Reloaded tmux config.'
# Use vi keybindings for tmux commandline input.
# Note that to get command mode you need to hit ESC twice...
set -g status-keys emacs
# Use vi keybindings in copy and choice modes
setw -g mode-keys vi
###########################################################################
# 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 management / navigation
# 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
# navigation with ctrl-{h,j,k,l} -- NO PREFIX
# https://gist.github.com/mislav/5189704
bind -n ^K run-shell 'tmux-vim-select-pane -U'
bind -n ^J run-shell 'tmux-vim-select-pane -D'
bind -n ^H run-shell 'tmux-vim-select-pane -L'
bind -n ^L run-shell 'tmux-vim-select-pane -R'
# 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
# easily toggle synchronization (mnemonic: e is for echo)
# sends input to all panes in a given window.
bind e setw synchronize-panes on
bind E setw synchronize-panes off
###########################################################################
# Scrollback / pastebuffer
# Vim-style copy/paste
unbind [
bind y copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy v begin-selection
bind -t vi-copy y copy-selection
bind -t vi-copy Escape cancel
###########################################################################
# Mouse mode
set -g mouse on
# set -g mode-mouse on
# set -g mouse-resize-pane on
# set -g mouse-select-pane on
# set -g mouse-select-window on
# Toggle mouse on
bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
# Toggle mouse off
bind M \
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF'
###########################################################################
# Color scheme (Solarized light)
# default statusbar colors
set-option -g status-bg colour231 #base2
set-option -g status-fg colour130 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour180 #base00
set-window-option -g window-status-bg default
# active window title colors
set-window-option -g window-status-current-fg colour196 #orange
set-window-option -g window-status-current-bg default
# pane border
set-option -g pane-active-border-fg black
set-option -g pane-active-border-bg white
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
###########################################################################no active gemsets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment