# color needs to be set early in tmux 1.8 for some reason set -g default-terminal "screen-256color" # Fix scrolling set -g terminal-overrides 'xterm*:smcup@:rmcup@' # https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf set-option -g status-bg colour235 #base02 set-option -g status-fg colour136 #yellow set-option -g status-attr default # set window split bind-key v split-window -h bind-key b split-window # detach bind-key C-d detach-client # Make C-a q kill the pane (simular to GNU screen) bind-key q confirm-before -p "kill-pane #P? (y/n)" kill-pane # cycle windows bind-key C-n next-window bind-key C-p previous-window # 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 # 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 dim if-shell "[[ `tmux -V` == *1.[89]* ]]" 'set-window-option -g window-status-last-fg colour136 # dark orange' if-shell "[[ `tmux -V` == *1.[89]* ]]" 'set-window-option -g window-status-last-bg default' if-shell "[[ `tmux -V` == *1.[89]* ]]" 'set-window-option -g window-status-last-attr dim' if-shell "[[ `tmux -V` == *1.9* ]]" 'set-window-option -g window-status-alert-fg default' if-shell "[[ `tmux -V` == *1.9* ]]" 'set-window-option -g window-status-alert-bg default' if-shell "[[ `tmux -V` == *1.9* ]]" 'set-window-option -g window-status-alert-attr reverse' set-window-option -g window-status-bell-fg default set-window-option -g window-status-bell-bg colour52 set-window-option -g window-status-bell-attr default set-window-option -g window-status-activity-fg default set-window-option -g window-status-activity-bg default set-window-option -g window-status-activity-attr underscore if-shell "[[ `tmux -V` == *1.9* ]]" 'set-window-option -g window-status-content-fg default' if-shell "[[ `tmux -V` == *1.9* ]]" 'set-window-option -g window-status-content-bg default' if-shell "[[ `tmux -V` == *1.9* ]]" 'set-window-option -g window-status-content-attr underscore' set-window-option -g window-status-format "#I:#W#F" set-window-option -g window-status-current-format "#I:#W#F" # pane border set-option -g pane-border-fg colour240 #colour235 #base02 set-option -g pane-active-border-fg yellow #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 green #green set-window-option -g clock-mode-style 24 # tmux >=2.2: does always use utf8, keep the option older environments # using tmux <2.2 (i.e. Debian Jessie) set -gq status-utf8 on # status bar set -g status on set -g status-keys emacs set -g status-interval 10 set -g status-justify centre set -g status-left-length 40 set -g status-left "#[fg=brightblack]|#[fg=green]#h#[fg=brightblack]|#[fg=brightblue]#(ip r g 8.8.8.8 | sed -rne 's/ uid.*//' -e 's/.*src //p' | xargs)#[fg=brightblack]|" set -g status-right-length 30 set -g status-right "#[fg=brightblack]|#[fg=brightblue]#S #I:#P#[fg=brightblack]|#[fg=green]%b/%d#[fg=brightblack]|#[fg=green]%H:%M#[fg=brightblack]|" # C-b is not acceptable -- Vim uses it set-option -g prefix C-a bind-key C-a last-window # Start numbering at 1 set -g base-index 1 set -g pane-base-index 1 # Allows for faster key repetition set -s escape-time 0 # Rather than constraining window size to the maximum size of any client # connected to the *session*, constrain window size to the maximum size of any # client connected to *that window*. Much more reasonable. setw -g aggressive-resize on # Allows us to use C-a a to send commands to a TMUX session inside # another TMUX session bind-key a send-prefix # Activity monitoring setw -g monitor-activity on set -g visual-activity on # hjkl pane traversal bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R bind C-h select-pane -L bind C-j select-pane -D bind C-k select-pane -U bind C-l select-pane -R # HJKL pane swapping in that direction # (NOTE: tmux doesn't support swap -L or -R) #bind H swap-pane -L bind J swap-pane -D bind K swap-pane -U #bind L swap-pane -R # resize like in vim # https://github.com/hatoishi/dotfiles/blob/master/tmux.conf bind < resize-pane -L 10 bind > resize-pane -R 10 bind - resize-pane -D 10 bind + resize-pane -U 10 # full-screen a pane (toggle) # http://blog.sanctum.geek.nz/zooming-tmux-panes/ bind z resize-pane -Z bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'" # reload config bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." # auto window rename set-window-option -g automatic-rename # logging toggle # https://unix.stackexchange.com/questions/5832/is-there-an-equivalent-of-gnu-screens-log-command-in-tmux bind-key H pipe-pane -o "exec cat >>$HOME/'#W-tmux.log'" '\;' display-message 'Toggled logging to $HOME/#W-tmux.log' # ------------------------------------------------------------------------ # https://github.com/neovim/neovim/issues/2093 set -g escape-time 20 # ------------------------------------------------------------------------ if-shell "[[ `tmux -V` == *1.* ]] || [[ `tmux -V` == *2.0* ]]" \ 'source ~/.tmux/mode-mouse-1.9-2.0.conf' \ 'source ~/.tmux/mode-mouse-2.1.conf' # ------------------------------------------------------------------------ if-shell "tmux -V | grep -q -e '\\<1\\.' -e '\\<2\\.[0-5]'" \ 'source ~/.tmux/vi-copy-mode-pre-2.6.conf' \ 'source ~/.tmux/vi-copy-mode-2.6.conf' # ------------------------------------------------------------------------ if-shell "[[ `tmux -V` == *1.9* ]] || [[ `tmux -V` == *[2-9].* ]]" \ 'source ~/.tmux/current-path-1.9+.conf' # ------------------------------------------------------------------------ source ~/.tmux/scripts/fit.conf