From 5c41188a31231e9c1ad37ef5f55d8dd21a78877e Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Mon, 26 Dec 2022 22:40:08 +0100 Subject: [PATCH] removed support for tmux < 2.4 --- .tmux.conf | 70 +++++++++--------------------------------------- .tmux.conf.local | 14 ++-------- README.md | 3 +-- 3 files changed, 15 insertions(+), 72 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index ee587dd..6c06415 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -109,43 +109,16 @@ bind U run "cut -c3- ~/.tmux.conf | sh -s _urlview #{pane_id}" bind F run "cut -c3- ~/.tmux.conf | sh -s _fpp #{pane_id} #{pane_current_path}" -# -- list choice (tmux < 2.4) -------------------------------------------------- - -# vi-choice is gone in tmux >= 2.4 -run -b 'tmux bind -t vi-choice h tree-collapse 2> /dev/null || true' -run -b 'tmux bind -t vi-choice l tree-expand 2> /dev/null || true' -run -b 'tmux bind -t vi-choice K start-of-list 2> /dev/null || true' -run -b 'tmux bind -t vi-choice J end-of-list 2> /dev/null || true' -run -b 'tmux bind -t vi-choice H tree-collapse-all 2> /dev/null || true' -run -b 'tmux bind -t vi-choice L tree-expand-all 2> /dev/null || true' -run -b 'tmux bind -t vi-choice Escape cancel 2> /dev/null || true' - - -# -- edit mode (tmux < 2.4) ---------------------------------------------------- - -# vi-edit is gone in tmux >= 2.4 -run -b 'tmux bind -ct vi-edit H start-of-line 2> /dev/null || true' -run -b 'tmux bind -ct vi-edit L end-of-line 2> /dev/null || true' -run -b 'tmux bind -ct vi-edit q cancel 2> /dev/null || true' -run -b 'tmux bind -ct vi-edit Escape cancel 2> /dev/null || true' - - # -- copy mode ----------------------------------------------------------------- bind Enter copy-mode # enter copy mode -run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true' -run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true' -run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true' -run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true' -run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi H send -X start-of-line 2> /dev/null || true' -run -b 'tmux bind -t vi-copy L end-of-line 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true' +bind -T copy-mode-vi v send -X begin-selection +bind -T copy-mode-vi C-v send -X rectangle-toggle +bind -T copy-mode-vi y send -X copy-selection-and-cancel +bind -T copy-mode-vi Escape send -X cancel +bind -T copy-mode-vi H send -X start-of-line +bind -T copy-mode-vi L send -X end-of-line # copy to X11 clipboard if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xsel -i -b"' @@ -1069,15 +1042,8 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # -e "s/#{prefix}/#[fg=$tmux_conf_theme_prefix_fg]#[bg=$tmux_conf_theme_prefix_bg]#[$tmux_conf_theme_prefix_attr]#{?client_prefix,$tmux_conf_theme_prefix ,$(printf "$tmux_conf_theme_prefix" | sed -e 's/./ /g') }/g" \ # -e "s/#{mouse}/#[fg=$tmux_conf_theme_mouse_fg]#[bg=$tmux_conf_theme_mouse_bg]#[$tmux_conf_theme_mouse_attr]#{?mouse,$tmux_conf_theme_mouse ,$(printf "$tmux_conf_theme_mouse" | sed -e 's/./ /g') }/g" \ # -e "s%#{synchronized}%#[fg=$tmux_conf_theme_synchronized_fg]#[bg=$tmux_conf_theme_synchronized_bg]#[$tmux_conf_theme_synchronized_attr]#{?pane_synchronized,$tmux_conf_theme_synchronized ,}%g" \ -# -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled #S)%g') -# -# if [ -n "$(tmux display -p '#{version}')" ]; then -# status_left=$(echo "$status_left" | sed \ -# -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#{?#{==:#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} #D),root},$tmux_conf_theme_root,}#[inherit]%g") -# else -# status_left=$(echo "$status_left" | sed \ -# -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#(cut -c3- ~/.tmux.conf | sh -s _root #{pane_pid} #{b:pane_tty} $tmux_conf_theme_root #D)#[inherit]%g") -# fi +# -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled #S)%g' \ +# -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#{?#{==:#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} #D),root},$tmux_conf_theme_root,}#[inherit]%g") # # status_left=$(printf '%s' "$status_left" | awk \ # -v status_bg="$tmux_conf_theme_status_bg" \ @@ -1157,15 +1123,8 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # -e "s/#{prefix}/#[fg=$tmux_conf_theme_prefix_fg]#[bg=$tmux_conf_theme_prefix_bg]#[$tmux_conf_theme_prefix_attr]#{?client_prefix,$tmux_conf_theme_prefix ,$(printf "$tmux_conf_theme_prefix" | sed -e 's/./ /g') }/g" \ # -e "s/#{mouse}/#[fg=$tmux_conf_theme_mouse_fg]#[bg=$tmux_conf_theme_mouse_bg]#[$tmux_conf_theme_mouse_attr]#{?mouse,$tmux_conf_theme_mouse ,$(printf "$tmux_conf_theme_mouse" | sed -e 's/./ /g') }/g" \ # -e "s%#{synchronized}%#[fg=$tmux_conf_theme_synchronized_fg]#[bg=$tmux_conf_theme_synchronized_bg]#[$tmux_conf_theme_synchronized_attr]#{?pane_synchronized,$tmux_conf_theme_synchronized ,}%g" \ -# -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled #S)%g') -# -# if [ -z "$(tmux display -p '#{version}')" ]; then -# status_right=$(echo "$status_right" | sed \ -# -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#{?#{==:#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} #D),root},$tmux_conf_theme_root,}#[inherit]%g") -# else -# status_right=$(echo "$status_right" | sed \ -# -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#(cut -c3- ~/.tmux.conf | sh -s _root #{pane_pid} #{b:pane_tty} $tmux_conf_theme_root #D)#[inherit]%g") -# fi +# -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled #S)%g' \ +# -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#{?#{==:#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} #D),root},$tmux_conf_theme_root,}#[inherit]%g") # # status_right=$(printf '%s' "$status_right" | awk \ # -v status_bg="$tmux_conf_theme_status_bg" \ @@ -1440,10 +1399,6 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # tmux set -gu '@tpm-install' \; set -gu '@tpm-update' \; set -gu '@tpm-clean' \; set -gu '@plugin' # fi # fi -# -# if [ -z "$window_active" ] && [ $_tmux_version -lt 240 ]; then -# tmux run -b "sleep $(expr $(tmux display -p '#{display-time}') / 500) && tmux set display-time 3000 \; display 'This configuration will soon require tmux 2.4+' \; set -u display-time" -# fi # } # # _apply_plugins() { @@ -1468,7 +1423,6 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # } # # _apply_configuration() { -# # window_active="$(tmux display -p '#{window_active}' 2>/dev/null || true)" # if [ -z "$window_active" ]; then # if ! command -v perl > /dev/null 2>&1; then @@ -1483,8 +1437,8 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # tmux run -b 'tmux set display-time 3000 \; display "This configuration requires awk" \; set -u display-time \; run "sleep 3" \; kill-server' # return # fi -# if [ $_tmux_version -lt 230 ]; then -# tmux run -b 'tmux set display-time 3000 \; display "This configuration requires tmux 2.3+" \; set -u display-time \; run "sleep 3" \; kill-server' +# if [ $_tmux_version -lt 240 ]; then +# tmux run -b 'tmux set display-time 3000 \; display "This configuration requires tmux 2.4+" \; set -u display-time \; run "sleep 3" \; kill-server' # return # fi # fi diff --git a/.tmux.conf.local b/.tmux.conf.local index 7fc8a09..559a685 100644 --- a/.tmux.conf.local +++ b/.tmux.conf.local @@ -5,16 +5,6 @@ # Copyright 2012— Gregory Pakosz (@gpakosz). -# -- navigation ---------------------------------------------------------------- - -# if you're running tmux within iTerm2 -# - and tmux is 1.9 or 1.9a -# - and iTerm2 is configured to let option key act as +Esc -# - and iTerm2 is configured to send [1;9A -> [1;9D for option + arrow keys -# then uncomment the following line to make Meta + arrow keys mapping work -#set -ga terminal-overrides "*:kUP3=\e[1;9A,*:kDN3=\e[1;9B,*:kRIT3=\e[1;9C,*:kLFT3=\e[1;9D" - - # -- windows & pane creation --------------------------------------------------- # new window retains current path, possible values are: @@ -44,7 +34,7 @@ tmux_conf_new_session_prompt=false # -- display ------------------------------------------------------------------- -# RGB 24-bit colour support (tmux >= 2.2), possible values are: +# RGB 24-bit colour support, possible values are: # - true # - false # - auto (default) @@ -96,7 +86,7 @@ tmux_conf_theme_colour_17="#e4e4e4" # white tmux_conf_theme_window_fg="default" tmux_conf_theme_window_bg="default" -# highlight focused pane (tmux >= 2.1), possible values are: +# highlight focused pane, possible values are: # - true # - false (default) tmux_conf_theme_highlight_focused_pane=false diff --git a/README.md b/README.md index dd79dec..2fd51a8 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,7 @@ Installation Requirements: - - tmux **`>= 2.3`** (soon `>= 2.4`) running inside Linux, Mac, OpenBSD, Cygwin - or WSL + - tmux **`>= 2.4`** running inside Linux, Mac, OpenBSD, Cygwin or WSL - awk, perl and sed - outside of tmux, `$TERM` must be set to `xterm-256color`