From 29929266eba3d2b0f1642903c1610956506ad434 Mon Sep 17 00:00:00 2001 From: nirenjan Date: Wed, 16 Jan 2013 18:47:34 -0800 Subject: [PATCH] Update tmux status with named constants for colors Changes to tmux.conf - Make it easier for users to adjust the colorscheme by using named constants to store the color names. - Highlight the active window using additional attributes instead of a jarring background. - Enable the aggressive-resize option - Remove unused key bindings - Bind L to choose-session - Allow the escape key to quit the choice window --- tmux.conf | 52 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/tmux.conf b/tmux.conf index 8cff72a..876e1b8 100644 --- a/tmux.conf +++ b/tmux.conf @@ -13,6 +13,9 @@ set-option -sg escape-time 50 # Enable UTF-8 set-window-option -g utf8 on +# Don't constrain the window size to smallest client size +set-window-option -g aggressive-resize on + # Enable mouse mode set-option -g mode-mouse on set-option -g mouse-select-pane on @@ -37,18 +40,25 @@ set-option -g display-time 1500 set-option -g base-index 1 set-option -g pane-base-index 1 +# Configure the tmux colours +# Based on Solarized [altercation/solarized] on GitHub +TMUX_STATUS_BG=brightblack +TMUX_STATUS_FG=white +TMUX_MESSAGE_BG=brightblack +TMUX_MESSAGE_FG=brightred + # Status bar set-option -g status on set-option -g status-interval 2 -set-option -g status-bg colour8 -set-option -g status-fg colour7 +set-option -g status-bg $TMUX_STATUS_BG +set-option -g status-fg $TMUX_STATUS_FG set-option -g status-utf8 on # Status bar - left # @ set-option -g status-left "#[fg=blue]#(whoami) " set-option -ga status-left "#[fg=green]#h " -set-option -ga status-left "#[default][#S]" +set-option -ga status-left "#[fg=brightmagenta][#S]" # Status bar - left length set-option -g status-left-length 40 @@ -60,18 +70,19 @@ set-option -ga status-right "#[fg=red]#(~/bin/stardate)" set-option -g status-right-length 30 # Status bar - window status -set-window-option -g window-status-current-bg red -set-window-option -g window-status-current-fg colour7 -set-window-option -g window-status-bg colour8 -set-window-option -g window-status-fg colour7 -set-window-option -g window-status-format "#I-#P:#W#F" -set-window-option -g window-status-current-format "#I-#P:#W#F" +set-window-option -g window-status-current-bg $TMUX_STATUS_BG +set-window-option -g window-status-current-fg cyan +set-window-option -g window-status-current-attr underscore +set-window-option -g window-status-bg $TMUX_STATUS_BG +set-window-option -g window-status-fg $TMUX_STATUS_FG +set-window-option -g window-status-format "#I.#P:#W#F" +set-window-option -g window-status-current-format "#I.#P:#W#F" # Message bar formatting -set-option -g message-bg colour7 -set-option -g message-fg black -set-option -g message-command-bg black -set-option -g message-command-fg colour7 +set-option -g message-bg $TMUX_MESSAGE_BG +set-option -g message-fg $TMUX_MESSAGE_FG +set-option -g message-command-bg $TMUX_MESSAGE_FG +set-option -g message-command-fg $TMUX_MESSAGE_BG # Pane highlighting set-option -g pane-active-border-fg green @@ -136,6 +147,21 @@ bind-key - \ # screen and the scrollback buffer too bind-key -n C-k clear-history +# Disable the choose-client key binding. It usually results in the current +# client getting detached. +unbind-key D + +# Rather than go with the last session, let the user pick from the list +# of available sessions +bind-key L choose-session + +# Don't waste time with the next-window and previous-window bindings +unbind-key n +unbind-key p + +# Allow the escape key to quit the choice window +bind-key -t vi-choice Escape cancel + # Terminator style pane switching # OSX Terminal.app, enable Use option as meta key # and delete the key bindings for Option Cursor left & Option Cursor right