From 93b8fe4dfe5ad2d4171acc8b38107ad7a695036e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 31 Jul 2012 09:12:40 +1200 Subject: Regroup tmux config This way I only have to run that terminal color test once, and it's much tidier overall. Also removed a couple features I never use. --- install | 17 ++++++++-------- tmux/tmux.conf | 57 +++++++++++++----------------------------------------- tmux/tmux.conf.256 | 17 ++++++++++++++++ 3 files changed, 39 insertions(+), 52 deletions(-) create mode 100644 tmux/tmux.conf.256 diff --git a/install b/install index 7367b0d4..37e7060e 100755 --- a/install +++ b/install @@ -6,14 +6,15 @@ git submodule --quiet update --init cd "${OLDPWD}" # Link in files, replacing whatever's already there. -ln -fs ".dotfiles/bash/bashrc" "${HOME}/.bashrc" -ln -fs ".dotfiles/bash/bash_profile" "${HOME}/.bash_profile" -ln -fs ".dotfiles/bash/bash_logout" "${HOME}/.bash_logout" -ln -fs ".dotfiles/git/gitconfig" "${HOME}/.gitconfig" -ln -fs ".dotfiles/readline/inputrc" "${HOME}/.inputrc" -ln -fs ".dotfiles/tmux/tmux.conf" "${HOME}/.tmux.conf" -ln -fs ".dotfiles/vim/vimrc" "${HOME}/.vimrc" -ln -fs ".dotfiles/vim/gvimrc" "${HOME}/.gvimrc" +ln -fs ".dotfiles/bash/bashrc" "${HOME}/.bashrc" +ln -fs ".dotfiles/bash/bash_profile" "${HOME}/.bash_profile" +ln -fs ".dotfiles/bash/bash_logout" "${HOME}/.bash_logout" +ln -fs ".dotfiles/git/gitconfig" "${HOME}/.gitconfig" +ln -fs ".dotfiles/readline/inputrc" "${HOME}/.inputrc" +ln -fs ".dotfiles/tmux/tmux.conf" "${HOME}/.tmux.conf" +ln -fs ".dotfiles/tmux/tmux.conf.256" "${HOME}/.tmux.conf.256" +ln -fs ".dotfiles/vim/vimrc" "${HOME}/.vimrc" +ln -fs ".dotfiles/vim/gvimrc" "${HOME}/.gvimrc" # Link in directories, removing whatever's already there first. if [ -e "${HOME}/.vim" ]; then diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 711a864d..753665aa 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -17,7 +17,7 @@ bind-key -r '-' resize-pane -D 5 bind-key -r '<' resize-pane -L 5 bind-key -r '>' resize-pane -R 5 -# Vim-like copy paste +# Vim-like select/yank bind-key -t vi-copy 'v' begin-selection bind-key -t vi-copy 'y' copy-selection @@ -27,56 +27,25 @@ bind-key j select-pane -D bind-key k select-pane -U bind-key l select-pane -R -# Vim-like pane swapping -bind-key J swap-pane -D -bind-key K swap-pane -U - # Activity set-window-option -g monitor-activity on set-window-option -g window-status-activity-attr none -if-shell 'test `tput colors` -eq 256' 'set-window-option -g window-status-activity-bg colour237' -if-shell 'test `tput colors` -eq 256' 'set-window-option -g window-status-activity-fg colour248' - -# Clipboard -set-option -g set-clipboard off - -# History -set-option -g history-limit 100000 - -# Indices -set-option -g base-index 1 - -# Messages -if-shell 'test `tput colors` -eq 256' 'set-option -g message-bg colour18' -if-shell 'test `tput colors` -eq 256' 'set-option -g message-fg colour231' - -# Modes -set-window-option -g mode-keys vi -if-shell 'test `tput colors` -eq 256' 'set-window-option -g mode-bg colour18' -if-shell 'test `tput colors` -eq 256' 'set-window-option -g mode-fg colour231' - -# Pane borders -if-shell 'test `tput colors` -eq 256' 'set-option -g pane-active-border-bg colour237' -if-shell 'test `tput colors` -eq 256' 'set-option -g pane-active-border-fg colour237' -if-shell 'test `tput colors` -eq 256' 'set-option -g pane-border-bg colour237' -if-shell 'test `tput colors` -eq 256' 'set-option -g pane-border-fg colour237' - -# Resize -set-window-option -g aggressive-resize on # Status bar set-option -g status-left '[#S]' set-option -g status-right '[#H] #(date +"%F %T")' -if-shell 'test `tput colors` -eq 256' 'set-option -g status-bg colour237' -if-shell 'test `tput colors` -eq 256' 'set-option -g status-fg colour248' -if-shell 'test `tput colors` -eq 256' 'set-window-option -g window-status-current-format "#[fg=colour231]#I:#W#F"' -if-shell 'test `tput colors` -eq 256' 'set-window-option -g window-status-format "#[fg=colour16]#I:#W#F"' - -# Terminal -CONTAINING_TERM=$TERM -set-option -s escape-time 0 -if-shell 'test `tput colors` -eq 256' 'set-option -g default-terminal "screen-256color"' -# Titles +# Miscellaneous +set-option -g base-index 1 +set-option -g escape-time 0 +set-option -g history-limit 100000 +set-option -g set-clipboard off +set-window-option -g aggressive-resize on set-window-option -g automatic-rename off +set-window-option -g mode-keys vi + +# Terminal handling +CONTAINING_TERM=$TERM +if-shell 'test -e ~/.tmux.conf.256 && test `tput colors` -eq 256' \ + 'source ~/.tmux.conf.256' diff --git a/tmux/tmux.conf.256 b/tmux/tmux.conf.256 new file mode 100644 index 00000000..97eb3833 --- /dev/null +++ b/tmux/tmux.conf.256 @@ -0,0 +1,17 @@ +# 256 color terminals +set-option -g default-terminal 'screen-256color' +set-option -g message-bg colour18 +set-option -g message-fg colour231 +set-option -g pane-active-border-bg colour237 +set-option -g pane-active-border-fg colour237 +set-option -g pane-border-bg colour237 +set-option -g pane-border-fg colour237 +set-option -g status-bg colour237 +set-option -g status-fg colour248 +set-window-option -g mode-bg colour18 +set-window-option -g mode-fg colour231 +set-window-option -g window-status-activity-bg colour237 +set-window-option -g window-status-activity-fg colour248 +set-window-option -g window-status-current-format "#[fg=colour231]#I:#W#F" +set-window-option -g window-status-format "#[fg=colour16]#I:#W#F" + -- cgit v1.2.3