# HG changeset patch # User edogawaconan # Date 1394341907 -32400 # Node ID 072662ced8b86cf939a2fe52eca1b0db552ba20b # Parent faf6bc91feb59b6dd43beeb883bd7aeb858a80a7 Per-version tmux config. diff -r faf6bc91feb5 -r 072662ced8b8 rc/bashrc --- a/rc/bashrc Tue Feb 25 16:44:02 2014 +0900 +++ b/rc/bashrc Sun Mar 09 14:11:47 2014 +0900 @@ -15,6 +15,8 @@ _org_path="${PATH}" +_os="$(uname -s)" + # Basic PATH export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/games" @@ -85,7 +87,7 @@ _grep="grep" _has_posix_grep=y -case "$(uname -s)" in +case "${_os}" in Linux) _has_gnu_ls=y _has_gnu_grep=y @@ -233,6 +235,9 @@ ;; esac +# Priority PATHs. Always enable. +PATH="${HOME}/bin:${HOME}/.ecos_bin:/opt/local/bin:/opt/local/sbin:${PATH}" + if command -v vim > /dev/null 2>&1; then alias vi=vim export EDITOR=vim @@ -263,7 +268,24 @@ alias 0pp="gzip | curl 'http://0paste.com/pastes.txt' -F 'paste[is_private]=1' -F 'paste[paste_gzip]=<-'" fi -# Priority PATHs. Always enable. -PATH="${HOME}/bin:${HOME}/.ecos_bin:/opt/local/bin:/opt/local/sbin:${PATH}" +if command -v tmux > /dev/null 2>&1; then + case "${_os}" in + OpenBSD) + # FIXME: OpenBSD version check + _tmux_conf_ver=1.9 + ;; + *) + case "$(tmux -V)" in + "tmux 1."[1-9][0-9]*|"tmux 1.9"*) _tmux_conf_ver=1.9;; + "tmux 1."[4-8]*) _tmux_conf_ver=1.4;; + *) _tmux_conf_ver=1.3;; + esac + ;; + esac + alias tmux="tmux -f '""${HOME}""/.tmux-""${_tmux_conf_ver}"".conf'" + unset _tmux_conf_ver +fi + +unset _os [ -f "${HOME}/.ecos_bash.after" ] && . "${HOME}/.ecos_bash.after" diff -r faf6bc91feb5 -r 072662ced8b8 rc/cshrc --- a/rc/cshrc Tue Feb 25 16:44:02 2014 +0900 +++ b/rc/cshrc Sun Mar 09 14:11:47 2014 +0900 @@ -49,6 +49,7 @@ alias ll ls -lA alias ls ls -F alias rm rm -i +alias tmux tmux -f ~/.tmux-1.3.conf if ($?prompt) then set gnuls_opts="--color=auto --group-directories-first -F" diff -r faf6bc91feb5 -r 072662ced8b8 rc/tmux-1.3.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rc/tmux-1.3.conf Sun Mar 09 14:11:47 2014 +0900 @@ -0,0 +1,22 @@ +set -g terminal-overrides '*:acsc@' + +set -g repeat-time 0 +set -g status-bg cyan +set -g status-fg white + +set -g status-left '#[bg=white,fg=black] #S #[default] ' + +set -g status-right '#[bg=white,fg=black] #H #[bg=black,fg=white] %b-%d %H:%M ' + +set -g status-utf8 on +setw -g utf8 on + +set -g pane-active-border-fg cyan + +set -g set-titles on +set -g set-titles-string '[#S] #I:#W #T' + +setw -g window-status-attr bold +setw -g window-status-current-attr bold +setw -g window-status-current-bg black +setw -g window-status-current-fg white diff -r faf6bc91feb5 -r 072662ced8b8 rc/tmux-1.4.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rc/tmux-1.4.conf Sun Mar 09 14:11:47 2014 +0900 @@ -0,0 +1,20 @@ +set -g repeat-time 0 +set -g status-bg cyan +set -g status-fg white + +set -g status-left '#[bg=white,fg=black] #S #[default] ' + +set -g status-right '#[bg=white,fg=black] #H #[bg=black,fg=white] %b-%d %H:%M ' + +set -g status-utf8 on +setw -g utf8 on + +set -g pane-active-border-fg cyan + +set -g set-titles on +set -g set-titles-string '[#S] #I:#W #T' + +setw -g window-status-attr bold +setw -g window-status-current-attr bold +setw -g window-status-current-bg black +setw -g window-status-current-fg white diff -r faf6bc91feb5 -r 072662ced8b8 rc/tmux-1.9.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rc/tmux-1.9.conf Sun Mar 09 14:11:47 2014 +0900 @@ -0,0 +1,24 @@ +set -g repeat-time 0 +set -g status-bg cyan +set -g status-fg white + +set -g status-left '#[bg=white,fg=black] #S #[default] ' + +set -g status-right '#[bg=white,fg=black] #H #[bg=black,fg=white] %b-%d %H:%M ' + +set -g status-utf8 on +setw -g utf8 on + +set -g pane-active-border-fg cyan + +set -g set-titles on +set -g set-titles-string '[#S] #I:#W #T' + +setw -g window-status-attr bold +setw -g window-status-current-attr bold +setw -g window-status-current-bg black +setw -g window-status-current-fg white + +bind-key c new-window -c "#{pane_current_path}" +bind-key '"' split-window -c "#{pane_current_path}" +bind-key % split-window -h -c "#{pane_current_path}" diff -r faf6bc91feb5 -r 072662ced8b8 rc/tmux.conf --- a/rc/tmux.conf Tue Feb 25 16:44:02 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -##PRE-1.4 -#set -g terminal-overrides '*:acsc@' - -##UNDEFINED. NEED CHECK WHICH VERSION -set -g repeat-time 0 -set -g status-bg cyan -set -g status-fg white - -set -g status-left '#[bg=white,fg=black] #S #[default] ' - -set -g status-right '#[bg=white,fg=black] #H #[bg=black,fg=white] %b-%d %H:%M ' - -set -g status-utf8 on -setw -g utf8 on - -set -g pane-active-border-fg cyan - -set -g set-titles on -set -g set-titles-string '[#S] #I:#W #T' - -setw -g window-status-attr bold -setw -g window-status-current-attr bold -setw -g window-status-current-bg black -setw -g window-status-current-fg white -#setw -g window-status-current-format '#I:#W' diff -r faf6bc91feb5 -r 072662ced8b8 setup --- a/setup Tue Feb 25 16:44:02 2014 +0900 +++ b/setup Sun Mar 09 14:11:47 2014 +0900 @@ -121,6 +121,15 @@ _echo "Ensured existence of ${@}" } +_tmux() { + # Remove old tmux config. + _rc uninstall "tmux.conf" ".tmux.conf" + for tmux_conf in "${rcdir}/tmux-"*.conf; do + tmux_conf_file="${tmux_conf##*/}" + _rc "${1}" "${tmux_conf_file}" ".${tmux_conf_file}" + done +} + _help() { cat <