1
0
Fork 0
mirror of synced 2024-12-04 14:45:38 -05:00

Compare commits

...

15 commits

Author SHA1 Message Date
Gregory Pakosz
cfb89a4a07 fixup! added support for configuration files in the following locations: - ~/.tmux.conf and ~/.tmux.conf.local - $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local - ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local 2023-01-14 16:13:59 +01:00
Gregory Pakosz
a9add6cc70 fixup! added support for configuration files in the following locations: - ~/.tmux.conf and ~/.tmux.conf.local - $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local - ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local 2023-01-14 14:51:45 +01:00
Gregory Pakosz
f44ff0a534 fixup! added support for configuration files in the following locations: - ~/.tmux.conf and ~/.tmux.conf.local - $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local - ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local 2023-01-14 14:51:45 +01:00
Gregory Pakosz
7d77e8e955 fixup! added support for configuration files in the following locations: - ~/.tmux.conf and ~/.tmux.conf.local - $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local - ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local 2023-01-14 14:51:45 +01:00
Gregory Pakosz
e31116bc9e fixup! added support for configuration files in the following locations: - ~/.tmux.conf and ~/.tmux.conf.local - $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local - ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local 2023-01-14 14:51:45 +01:00
Gregory Pakosz
8916a7442c fixup! added support for configuration files in the following locations: - ~/.tmux.conf and ~/.tmux.conf.local - $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local - ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local 2023-01-14 14:51:45 +01:00
Gregory Pakosz
31f88acb23 fixup! added support for configuration files in the following locations: - ~/.tmux.conf and ~/.tmux.conf.local - $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local - ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local 2023-01-14 14:51:45 +01:00
Gregory Pakosz
7ec644007a fixup! added support for configuration files in the following locations: - ~/.tmux.conf and ~/.tmux.conf.local - $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local - ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local 2023-01-14 14:51:45 +01:00
Gregory Pakosz
c5c58d9d1f fixup! added support for configuration files in the following locations: - ~/.tmux.conf and ~/.tmux.conf.local - $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local - ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local 2023-01-14 14:51:45 +01:00
Gregory Pakosz
4a461e9180 fixup! added support for configuration files in the following locations: - ~/.tmux.conf and ~/.tmux.conf.local - $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local - ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local 2023-01-14 14:51:45 +01:00
Gregory Pakosz
2b4990d985 fixup! added support for configuration files in the following locations: - ~/.tmux.conf and ~/.tmux.conf.local - $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local - ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local 2023-01-14 14:51:45 +01:00
Gregory Pakosz
b2da1f298e fixup! added support for configuration files in the following locations: - ~/.tmux.conf and ~/.tmux.conf.local - $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local - ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local 2023-01-14 14:51:45 +01:00
Gregory Pakosz
8bfa2adf56 fixup! added support for configuration files in the following locations: - ~/.tmux.conf and ~/.tmux.conf.local - $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local - ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local 2023-01-14 14:51:45 +01:00
Gregory Pakosz
a79527fbaa added support for configuration files in the following locations:
- ~/.tmux.conf and ~/.tmux.conf.local
- $XDG_CONFIG_HOME/tmux/tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf.local
- ~/.config/tmux/tmux.conf and ~/.config/tmux/tmux.conf.local

location of configuration files is determined by the following environment variables:
- TMUX_CONF
- TMUX_CONF_LOCAL

the TMUX_EXECUTABLE environment variable contains the path to the tmux executable
currently parsing the configuration
2023-01-14 14:51:45 +01:00
Gregory Pakosz
2cf4d9a104 make sure to use /usr/bin/infocmp to probe if tmux-256color is available system wide
on macOS, here are the steps to install tmux-256color system wide
$ $(brew --prefix ncurses)/bin/infocmp tmux-256color > /tmp/tmux-256color.info
$ /usr/bin/tic -x /tmp/tmux-256color.info

which will install tmux-256color in ~/.terminfo/74/tmux-256color

resolves #530, resolves #592, resolves #601
2023-01-09 10:39:40 +01:00
2 changed files with 144 additions and 96 deletions

View file

@ -1,4 +1,4 @@
# : << EOF
# : << 'EOF'
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
@ -10,7 +10,7 @@
# -- general -------------------------------------------------------------------
set -g default-terminal "screen-256color"
if 'infocmp -x tmux-256color > /dev/null 2>&1' 'set -g default-terminal "tmux-256color"'
if '/usr/bin/infocmp -x tmux-256color > /dev/null 2>&1' 'set -g default-terminal "tmux-256color"'
setw -g xterm-keys on
set -s escape-time 10 # faster command sequences
@ -26,10 +26,10 @@ setw -q -g utf8 on
set -g history-limit 5000 # boost history
# edit configuration
bind e new-window -n "~/.tmux.conf.local" sh -c '${EDITOR:-vim} ~/.tmux.conf.local && tmux source ~/.tmux.conf && tmux display "~/.tmux.conf sourced"'
bind e new-window -n "#{TMUX_CONF_LOCAL}" sh -c '${EDITOR:-vim} "$TMUX_CONF_LOCAL" && "$TMUX_EXECUTABLE" source "$TMUX_CONF" \; display "$TMUX_CONF_LOCAL sourced"'
# reload configuration
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
bind r run '"$TMUX_EXECUTABLE" source "$TMUX_CONF"' \; display "#{TMUX_CONF} sourced"
# -- display -------------------------------------------------------------------
@ -80,7 +80,7 @@ bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# maximize current pane
bind + run 'cut -c3- ~/.tmux.conf | sh -s _maximize_pane "#{session_name}" #D'
bind + run "cut -c3- \"#{TMUX_CONF}\" | sh -s _maximize_pane '#{session_name}' '#D'"
# pane resizing
bind -r H resize-pane -L 2
@ -96,17 +96,17 @@ bind -r C-l next-window # select next window
bind Tab last-window # move to last active window
# toggle mouse
bind m run "cut -c3- ~/.tmux.conf | sh -s _toggle_mouse"
bind m run "cut -c3- \"#{TMUX_CONF}\" | sh -s _toggle_mouse"
# -- urlview -------------------------------------------------------------------
bind U run "cut -c3- ~/.tmux.conf | sh -s _urlview #{pane_id}"
bind U run "cut -c3- \"#{TMUX_CONF}\" | sh -s _urlview '#{pane_id}'"
# -- facebook pathpicker -------------------------------------------------------
bind F run "cut -c3- ~/.tmux.conf | sh -s _fpp #{pane_id} #{pane_current_path}"
bind F run "cut -c3- \"#{TMUX_CONF}\" | sh -s _fpp '#{pane_id}' '#{pane_current_path}'"
# -- copy mode -----------------------------------------------------------------
@ -121,16 +121,16 @@ 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"'
if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"'
if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "\"$TMUX_EXECUTABLE\" save-buffer - | xsel -i -b"'
if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "\"$TMUX_EXECUTABLE\" save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"'
# copy to Wayland clipboard
if -b 'command -v wl-copy > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | wl-copy"'
if -b 'command -v wl-copy > /dev/null 2>&1' 'bind y run -b "\"$TMUX_EXECUTABLE\" save-buffer - | wl-copy"'
# copy to macOS clipboard
if -b 'command -v pbcopy > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | pbcopy"'
if -b 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | reattach-to-user-namespace pbcopy"'
if -b 'command -v pbcopy > /dev/null 2>&1' 'bind y run -b "\"$TMUX_EXECUTABLE\" save-buffer - | pbcopy"'
if -b 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind y run -b "\"$TMUX_EXECUTABLE\" save-buffer - | reattach-to-user-namespace pbcopy"'
# copy to Windows clipboard
if -b 'command -v clip.exe > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | clip.exe"'
if -b '[ -c /dev/clipboard ]' 'bind y run -b "tmux save-buffer - > /dev/clipboard"'
if -b 'command -v clip.exe > /dev/null 2>&1' 'bind y run -b "\"$TMUX_EXECUTABLE\" save-buffer - | clip.exe"'
if -b '[ -c /dev/clipboard ]' 'bind y run -b "\"$TMUX_EXECUTABLE\" save-buffer - > /dev/clipboard"'
# -- buffers -------------------------------------------------------------------
@ -142,9 +142,18 @@ bind P choose-buffer # choose which buffer to paste from
# -- 8< ------------------------------------------------------------------------
source -q ~/.tmux.conf.local
run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
%if #{==:#{TMUX_EXECUTABLE},}
run 'TMUX_EXECUTABLE="$(lsof -b -w -a -d txt -p #{pid} -Fn 2>/dev/null | perl -n -e "if (s/^n((?:.(?!dylib$|so$))+)$/\1/g) { print; exit } } exit 1; {" || readlink "/proc/#{pid}/exe" 2>/dev/null || printf tmux)"; $TMUX_EXECUTABLE -S #{socket_path} set-environment -g TMUX_EXECUTABLE "$TMUX_EXECUTABLE"'
%endif
%if #{==:#{TMUX_CONF},}
run '"$TMUX_EXECUTABLE" set-environment -g TMUX_CONF $(for conf in "$HOME/.tmux.conf" "$XDG_CONFIG_HOME/tmux/tmux.conf" "$HOME/.config/tmux/tmux.conf"; do [ -f "$conf" ] && printf "%s" "$conf" && break; done)'
%endif
%if #{==:#{TMUX_CONF_LOCAL},}
run '"$TMUX_EXECUTABLE" set-environment -g TMUX_CONF_LOCAL "$TMUX_CONF.local"'
%endif
run '"$TMUX_EXECUTABLE" source "$TMUX_CONF_LOCAL"'
run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
# EOF
#
@ -166,6 +175,21 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
#
# _uname_s=$(uname -s)
#
# [ -z "$TMUX" ] && exit 666
# TMUX_SOCKET=$(printf '%s' "$TMUX" | cut -d, -f1)
#
# if [ -z "$TMUX_EXECUTABLE" ]; then
# TMUX_PID=$(printf '%s' "$TMUX" | cut -d, -f2)
# TMUX_EXECUTABLE=$(lsof -b -w -a -d txt -p "$TMUX_PID" -Fn 2>/dev/null | perl -n -e "if (s/^n((?:.(?!dylib$|so$))+)$/\1/g) { print; exit } } exit 1; {" || readlink "/proc/$TMUX_PID/exe" 2>/dev/null || printf tmux)
# fi
# if [ x"$TMUX_EXECUTABLE" = x"tmux" ]; then
# TMUX_EXECUTABLE="command tmux"
# fi
#
# tmux() {
# "$TMUX_EXECUTABLE" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} "$@"
# }
#
# _tmux_version=$(tmux -V | awk '{gsub(/[^0-9.]/, "", $2); print ($2+0) * 100}')
#
# _is_true() {
@ -233,12 +257,12 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# if [ -z "$restore" ]; then
# [ "$(tmux list-panes -t "$current_session:" | wc -l | sed 's/^ *//g')" -eq 1 ] && tmux display "Can't maximize with only one pane" && return
# current_pane_height=$(tmux display -t "$current_pane" -p "#{pane_height}")
# info=$(tmux new-window -t "$current_session:" -F "#{session_name}:#{window_index}.#{pane_id}" -P "maximized... 2>/dev/null & tmux setw -t \"$current_session:\" remain-on-exit on; printf \"\\033[\$(tput lines);0fPane has been maximized, press <prefix>+ to restore\n\" '$current_pane'")
# info=$(tmux new-window -t "$current_session:" -F "#{session_name}:#{window_index}.#{pane_id}" -P "maximized... 2>/dev/null & \"$TMUX_EXECUTABLE\" ${TMUX_SOCKET:+-S \"$TMUX_SOCKET\"} setw -t \"$current_session:\" remain-on-exit on; printf \"\\034[\$(tput lines);0fPane has been maximized, press <prefix>+ to restore\n\" '$current_pane'")
# session_window=${info%.*}
# new_pane=${info#*.}
#
# retry=1000
# while [ x"$(tmux list-panes -t "$session_window" -F '#{session_name}:#{window_index}.#{pane_id} #{pane_dead}' 2>/dev/null)" != x"$info 1" ] && [ "$retry" -ne 0 ]; do
# retry=20
# while [ x"$("$TMUX_EXECUTABLE" -S "$TMUX_SOCKET" list-panes -t "$session_window" -F '#{session_name}:#{window_index}.#{pane_id} #{pane_dead}' 2>/dev/null)" != x"$info 1" ] && [ "$retry" -ne 0 ]; do
# sleep 0.1
# retry=$((retry - 1))
# done
@ -719,7 +743,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# _apply_bindings() {
# cfg=$(mktemp) && trap 'rm -f $cfg*' EXIT
#
# tmux list-keys | grep -vF 'tmux.conf.local' | grep -E 'new-window|split(-|_)window|new-session|copy-selection|copy-pipe' > "$cfg"
# tmux list-keys | grep -vF 'TMUX_CONF_LOCAL' | grep -E 'new-window|split(-|_)window|new-session|copy-selection|copy-pipe' > "$cfg"
#
# # tmux 3.0 doesn't include 02254d1e5c881be95fd2fc37b4c4209640b6b266 and the
# # output of list-keys can be truncated
@ -735,7 +759,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# tmux_conf_new_pane_retain_current_path=${tmux_conf_new_pane_retain_current_path:-true}
# if ! _is_disabled "$tmux_conf_new_pane_retain_current_path"; then
# perl -p -i -e "
# s/\brun-shell\b\s+(\"|')cut\s+-c3-\s+~\/\.tmux\.conf\s+\|\s+sh\s+-s\s+_split_window\s+#\{b:pane_tty\}([^\n\1]*)(\s+-c\s+((?:\\\\\")?|\"?|'?)#\{pane_current_path\}\4)([^\n\1]*)\1/run-shell \1cut -c3- ~\/.tmux.conf | sh -s _split_window #{pane_pid} #{b:pane_tty}\2\5\1/g
# s/\brun-shell\b\s+(\"|')cut\s+-c3-\s+~\/\.tmux\.conf\s+\|\s+sh\s+-s\s+_split_window\s+#\{b:pane_tty\}([^\n\1]*)(\s+-c\s+((?:\\\\\")?|\"?|'?)#\{pane_current_path\}\4)([^\n\1]*)\1/run-shell \1cut -c3- ~\/.tmux.conf | sh -s _split_window #\{pane_pid\} #\{b:pane_tty\}\2\5\1/g
# ;
# s/\brun-shell\b(\s+((?:\\\\\")?|\"?|'?)cut\s+-c3-\s+~\/\.tmux\.conf\s+\|\s+sh\s+-s\s+_split_window\s+((?:\\\\\")?|\"?|'?)#\{b:pane_tty\}\3)(.*?)\2/split-window\4/g
# ;
@ -1180,50 +1204,50 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# # -- variables -------------------------------------------------------------
#
# set_titles_string=$(printf '%s' "${tmux_conf_theme_terminal_title:-$(tmux show -gv set-titles-string)}" | sed \
# -e 's%#{circled_window_index}%#(cut -c3- ~/.tmux.conf | sh -s _circled #I)%g' \
# -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled #S)%g' \
# -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} false #D)%g' \
# -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} false false #h #D)%g' \
# -e 's%#{hostname_full}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} false true #H #D)%g' \
# -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} true #D)%g' \
# -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} true false #h #D)%g' \
# -e 's%#{hostname_full_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} true true #H #D)%g')
# -e 's%#{circled_window_index}%#(cut -c3- "#{TMUX_CONF}" | sh -s _circled #I)%g' \
# -e 's%#{circled_session_name}%#(cut -c3- "#{TMUX_CONF}" | sh -s _circled #S)%g' \
# -e 's%#{username}%#(cut -c3- "#{TMUX_CONF}" | sh -s _username #{pane_pid} #{b:pane_tty} false #D)%g' \
# -e 's%#{hostname}%#(cut -c3- "#{TMUX_CONF}" | sh -s _hostname #{pane_pid} #{b:pane_tty} false false #h #D)%g' \
# -e 's%#{hostname_full}%#(cut -c3- "#{TMUX_CONF}" | sh -s _hostname #{pane_pid} #{b:pane_tty} false true #H #D)%g' \
# -e 's%#{username_ssh}%#(cut -c3- "#{TMUX_CONF}" | sh -s _username #{pane_pid} #{b:pane_tty} true #D)%g' \
# -e 's%#{hostname_ssh}%#(cut -c3- "#{TMUX_CONF}" | sh -s _hostname #{pane_pid} #{b:pane_tty} true false #h #D)%g' \
# -e 's%#{hostname_full_ssh}%#(cut -c3- "#{TMUX_CONF}" | sh -s _hostname #{pane_pid} #{b:pane_tty} true true #H #D)%g')
#
# window_status_format=$(printf '%s' "${window_status_format:-$(tmux show -gv window-status-format)}" | sed \
# -e 's%#{circled_window_index}%#(cut -c3- ~/.tmux.conf | sh -s _circled #I)%g' \
# -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled #S)%g' \
# -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} false #D)%g' \
# -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} false false #h #D)%g' \
# -e 's%#{hostname_full}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} false true #H #D)%g' \
# -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} true #D)%g' \
# -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} true false #h #D)%g' \
# -e 's%#{hostname_full_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} true true #H #D)%g')
# -e 's%#{circled_window_index}%#(cut -c3- "#{TMUX_CONF}" | sh -s _circled #I)%g' \
# -e 's%#{circled_session_name}%#(cut -c3- "#{TMUX_CONF}" | sh -s _circled #S)%g' \
# -e 's%#{username}%#(cut -c3- "#{TMUX_CONF}" | sh -s _username #{pane_pid} #{b:pane_tty} false #D)%g' \
# -e 's%#{hostname}%#(cut -c3- "#{TMUX_CONF}" | sh -s _hostname #{pane_pid} #{b:pane_tty} false false #h #D)%g' \
# -e 's%#{hostname_full}%#(cut -c3- "#{TMUX_CONF}" | sh -s _hostname #{pane_pid} #{b:pane_tty} false true #H #D)%g' \
# -e 's%#{username_ssh}%#(cut -c3- "#{TMUX_CONF}" | sh -s _username #{pane_pid} #{b:pane_tty} true #D)%g' \
# -e 's%#{hostname_ssh}%#(cut -c3- "#{TMUX_CONF}" | sh -s _hostname #{pane_pid} #{b:pane_tty} true false #h #D)%g' \
# -e 's%#{hostname_full_ssh}%#(cut -c3- "#{TMUX_CONF}" | sh -s _hostname #{pane_pid} #{b:pane_tty} true true #H #D)%g')
#
# window_status_current_format=$(printf '%s' "${window_status_current_format:-$(tmux show -gv window-status-current-format)}" | sed \
# -e 's%#{circled_window_index}%#(cut -c3- ~/.tmux.conf | sh -s _circled #I)%g' \
# -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled #S)%g' \
# -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} false #D)%g' \
# -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} false false #h #D)%g' \
# -e 's%#{hostname_full}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} false true #H #D)%g' \
# -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} true #D)%g' \
# -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} true false #h #D)%g' \
# -e 's%#{hostname_full_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} true true #H #D)%g')
# -e 's%#{circled_window_index}%#(cut -c3- "#{TMUX_CONF}" | sh -s _circled #I)%g' \
# -e 's%#{circled_session_name}%#(cut -c3- "#{TMUX_CONF}" | sh -s _circled #S)%g' \
# -e 's%#{username}%#(cut -c3- "#{TMUX_CONF}" | sh -s _username #{pane_pid} #{b:pane_tty} false #D)%g' \
# -e 's%#{hostname}%#(cut -c3- "#{TMUX_CONF}" | sh -s _hostname #{pane_pid} #{b:pane_tty} false false #h #D)%g' \
# -e 's%#{hostname_full}%#(cut -c3- "#{TMUX_CONF}" | sh -s _hostname #{pane_pid} #{b:pane_tty} false true #H #D)%g' \
# -e 's%#{username_ssh}%#(cut -c3- "#{TMUX_CONF}" | sh -s _username #{pane_pid} #{b:pane_tty} true #D)%g' \
# -e 's%#{hostname_ssh}%#(cut -c3- "#{TMUX_CONF}" | sh -s _hostname #{pane_pid} #{b:pane_tty} true false #h #D)%g' \
# -e 's%#{hostname_full_ssh}%#(cut -c3- "#{TMUX_CONF}" | sh -s _hostname #{pane_pid} #{b:pane_tty} true true #H #D)%g')
#
# status_left=$(printf '%s' "${status_left:-$(tmux show -gv status-left)}" | sed \
# -e "s/#{pairing}/#{?session_many_attached,$tmux_conf_theme_pairing ,}/g" \
# -e "s/#{prefix}/#{?client_prefix,$tmux_conf_theme_prefix ,$(printf "$tmux_conf_theme_prefix" | sed -e 's/./ /g') }/g" \
# -e "s/#{mouse}/#{?mouse,$tmux_conf_theme_mouse ,$(printf "$tmux_conf_theme_mouse" | sed -e 's/./ /g') }/g" \
# -e "s%#{synchronized}%#{?pane_synchronized,$tmux_conf_theme_synchronized ,}%g" \
# -e "s%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled #S)%g" \
# -e "s%#{root}%#{?#{==:#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} #D),root},$tmux_conf_theme_root,}%g")
# -e "s%#{circled_session_name}%#(cut -c3- \"#{TMUX_CONF}\" | sh -s _circled #S)%g" \
# -e "s%#{root}%#{?#{==:#(cut -c3- \"#{TMUX_CONF}\" | sh -s _username #{pane_pid} #{b:pane_tty} #D),root},$tmux_conf_theme_root,}%g")
#
# status_right=$(printf '%s' "${status_right:-$(tmux show -gv status-right)}" | sed \
# -e "s/#{pairing}/#{?session_many_attached,$tmux_conf_theme_pairing ,}/g" \
# -e "s/#{prefix}/#{?client_prefix,$tmux_conf_theme_prefix ,$(printf "$tmux_conf_theme_prefix" | sed -e 's/./ /g') }/g" \
# -e "s/#{mouse}/#{?mouse,$tmux_conf_theme_mouse ,$(printf "$tmux_conf_theme_mouse" | sed -e 's/./ /g') }/g" \
# -e "s%#{synchronized}%#{?pane_synchronized,$tmux_conf_theme_synchronized ,}%g" \
# -e "s%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled #S)%g" \
# -e "s%#{root}%#{?#{==:#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} #D),root},$tmux_conf_theme_root,}%g")
# -e "s%#{circled_session_name}%#(cut -c3- \"#{TMUX_CONF}\" | sh -s _circled #S)%g" \
# -e "s%#{root}%#{?#{==:#(cut -c3- \"#{TMUX_CONF}\" | sh -s _username #{pane_pid} #{b:pane_tty} #D),root},$tmux_conf_theme_root,}%g")
#
# tmux_conf_battery_bar_symbol_full=$(_decode_unicode_escapes "${tmux_conf_battery_bar_symbol_full:-◼}")
# tmux_conf_battery_bar_symbol_empty=$(_decode_unicode_escapes "${tmux_conf_battery_bar_symbol_empty:-◻}")
@ -1234,7 +1258,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# tmux_conf_battery_status_charging=$(_decode_unicode_escapes "${tmux_conf_battery_status_charging:-↑}") # U+2191
# tmux_conf_battery_status_discharging=$(_decode_unicode_escapes "${tmux_conf_battery_status_discharging:-↓}") # U+2193
#
# _pkillf 'cut -c3- ~/\.tmux\.conf \| sh -s _battery_bar'
# _pkillf "cut -c3- \"$TMUX_CONF\" \| sh -s _battery_bar"
# _battery_info
# if [ "$charge" != 0 ]; then
# case "$status_left $status_right" in
@ -1251,16 +1275,16 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# -e 's/#\{(\?)?battery_vbar/#\{\1@battery_vbar/g' \
# -e 's/#\{(\?)?battery_status/#\{\1@battery_status/g' \
# -e 's/#\{(\?)?battery_percentage/#\{\1@battery_percentage/g')
# status_right="#(echo; nice cut -c3- ~/.tmux.conf | sh -s _battery_status \"$tmux_conf_battery_status_charging\" \"$tmux_conf_battery_status_discharging\")$status_right"
# status_right="#(echo; nice cut -c3- \"$TMUX_CONF\" | sh -s _battery_status \"$tmux_conf_battery_status_charging\" \"$tmux_conf_battery_status_discharging\")$status_right"
# interval=60
# if [ $_tmux_version -ge 320 ]; then
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \$sleep_pid; exit 0' TERM; while [ x\"\$(tmux -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- ~/.tmux.conf | sh -s _battery_bar \"$tmux_conf_battery_bar_symbol_full\" \"$tmux_conf_battery_bar_symbol_empty\" \"$tmux_conf_battery_bar_length\" \"$tmux_conf_battery_bar_palette\" \"$tmux_conf_battery_hbar_palette\" \"$tmux_conf_battery_vbar_palette\"; sleep $interval & sleep_pid=\$!; wait \$sleep_pid; sleep_pid=; done"
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \$sleep_pid; exit 0' TERM; while [ x\"\$(\"$TMUX_EXECUTABLE\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _battery_bar \"$tmux_conf_battery_bar_symbol_full\" \"$tmux_conf_battery_bar_symbol_empty\" \"$tmux_conf_battery_bar_length\" \"$tmux_conf_battery_bar_palette\" \"$tmux_conf_battery_hbar_palette\" \"$tmux_conf_battery_vbar_palette\"; sleep $interval & sleep_pid=\$!; wait \$sleep_pid; sleep_pid=; done"
# elif [ $_tmux_version -ge 280 ]; then
# status_right="#(echo; while [ x\"\$(tmux -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- ~/.tmux.conf | sh -s _battery_bar \"$tmux_conf_battery_bar_symbol_full\" \"$tmux_conf_battery_bar_symbol_empty\" \"$tmux_conf_battery_bar_length\" \"$tmux_conf_battery_bar_palette\" \"$tmux_conf_battery_hbar_palette\" \"$tmux_conf_battery_vbar_palette\"; sleep $interval; done)$status_right"
# status_right="#(echo; while [ x\"\$(\"$TMUX_EXECUTABLE\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _battery_bar \"$tmux_conf_battery_bar_symbol_full\" \"$tmux_conf_battery_bar_symbol_empty\" \"$tmux_conf_battery_bar_length\" \"$tmux_conf_battery_bar_palette\" \"$tmux_conf_battery_hbar_palette\" \"$tmux_conf_battery_vbar_palette\"; sleep $interval; done)$status_right"
# elif [ $_tmux_version -gt 240 ]; then
# status_right="#(echo; while :; do nice cut -c3- ~/.tmux.conf | sh -s _battery_bar \"$tmux_conf_battery_bar_symbol_full\" \"$tmux_conf_battery_bar_symbol_empty\" \"$tmux_conf_battery_bar_length\" \"$tmux_conf_battery_bar_palette\" \"$tmux_conf_battery_hbar_palette\" \"$tmux_conf_battery_vbar_palette\"; sleep $interval; done)$status_right"
# status_right="#(echo; while :; do nice cut -c3- \"$TMUX_CONF\" | sh -s _battery_bar \"$tmux_conf_battery_bar_symbol_full\" \"$tmux_conf_battery_bar_symbol_empty\" \"$tmux_conf_battery_bar_length\" \"$tmux_conf_battery_bar_palette\" \"$tmux_conf_battery_hbar_palette\" \"$tmux_conf_battery_vbar_palette\"; sleep $interval; done)$status_right"
# else
# status_right="#(nice cut -c3- ~/.tmux.conf | sh -s _battery_bar \"$tmux_conf_battery_bar_symbol_full\" \"$tmux_conf_battery_bar_symbol_empty\" \"$tmux_conf_battery_bar_length\" \"$tmux_conf_battery_bar_palette\" \"$tmux_conf_battery_hbar_palette\" \"$tmux_conf_battery_vbar_palette\")$status_right"
# status_right="#(nice cut -c3- \"$TMUX_CONF\" | sh -s _battery_bar \"$tmux_conf_battery_bar_symbol_full\" \"$tmux_conf_battery_bar_symbol_empty\" \"$tmux_conf_battery_bar_length\" \"$tmux_conf_battery_bar_palette\" \"$tmux_conf_battery_hbar_palette\" \"$tmux_conf_battery_vbar_palette\")$status_right"
# fi
# ;;
# esac
@ -1269,23 +1293,23 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# case "$status_left $status_right" in
# *'#{username}'*|*'#{hostname}'*|*'#{hostname_full}'*|*'#{username_ssh}'*|*'#{hostname_ssh}'*|*'#{hostname_full_ssh}'*)
# status_left=$(echo "$status_left" | sed \
# -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} false #D)%g' \
# -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} false false #h #D)%g' \
# -e 's%#{hostname_full}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} false true #H #D)%g' \
# -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} true #D)%g' \
# -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} true false #h #D)%g' \
# -e 's%#{hostname_full_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} true true #H #D)%g')
# -e "s%#{username}%#(cut -c3- \"$TMUX_CONF\" | sh -s _username #{pane_pid} #{b:pane_tty} false #D)%g" \
# -e "s%#{hostname}%#(cut -c3- \"$TMUX_CONF\" | sh -s _hostname #{pane_pid} #{b:pane_tty} false false #h #D)%g" \
# -e "s%#{hostname_full}%#(cut -c3- \"$TMUX_CONF\" | sh -s _hostname #{pane_pid} #{b:pane_tty} false true #H #D)%g" \
# -e "s%#{username_ssh}%#(cut -c3- \"$TMUX_CONF\" | sh -s _username #{pane_pid} #{b:pane_tty} true #D)%g" \
# -e "s%#{hostname_ssh}%#(cut -c3- \"$TMUX_CONF\" | sh -s _hostname #{pane_pid} #{b:pane_tty} true false #h #D)%g" \
# -e "s%#{hostname_full_ssh}%#(cut -c3- \"$TMUX_CONF\" | sh -s _hostname #{pane_pid} #{b:pane_tty} true true #H #D)%g")
# status_right=$(echo "$status_right" | sed \
# -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} false #D)%g' \
# -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} false false #h #D)%g' \
# -e 's%#{hostname_full}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} false true #H #D)%g' \
# -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_pid} #{b:pane_tty} true #D)%g' \
# -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} true false #h #D)%g' \
# -e 's%#{hostname_full_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_pid} #{b:pane_tty} true true #H #D)%g')
# -e "s%#{username}%#(cut -c3- \"$TMUX_CONF\" | sh -s _username #{pane_pid} #{b:pane_tty} false #D)%g" \
# -e "s%#{hostname}%#(cut -c3- \"$TMUX_CONF\" | sh -s _hostname #{pane_pid} #{b:pane_tty} false false #h #D)%g" \
# -e "s%#{hostname_full}%#(cut -c3- \"$TMUX_CONF\" | sh -s _hostname #{pane_pid} #{b:pane_tty} false true #H #D)%g" \
# -e "s%#{username_ssh}%#(cut -c3- \"$TMUX_CONF\" | sh -s _username #{pane_pid} #{b:pane_tty} true #D)%g" \
# -e "s%#{hostname_ssh}%#(cut -c3- \"$TMUX_CONF\" | sh -s _hostname #{pane_pid} #{b:pane_tty} true false #h #D)%g" \
# -e "s%#{hostname_full_ssh}%#(cut -c3- \"$TMUX_CONF\" | sh -s _hostname #{pane_pid} #{b:pane_tty} true true #H #D)%g")
# ;;
# esac
#
# _pkillf 'cut -c3- ~/\.tmux\.conf \| sh -s _uptime'
# _pkillf "cut -c3- \"$TMUX_CONF\" \| sh -s _uptime"
# case "$status_left $status_right" in
# *'#{uptime_'*|*'#{?uptime_'*)
# status_left=$(echo "$status_left" | perl -p -e '
@ -1309,18 +1333,18 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# ;;
# esac
# if [ $_tmux_version -ge 320 ]; then
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \$sleep_pid; exit 0' TERM; while [ x\"\$(tmux -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- ~/.tmux.conf | sh -s _uptime; sleep $interval & sleep_pid=\$!; wait \$sleep_pid; sleep_pid=; done"
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \$sleep_pid; exit 0' TERM; while [ x\"\$(\"$TMUX_EXECUTABLE\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _uptime; sleep $interval & sleep_pid=\$!; wait \$sleep_pid; sleep_pid=; done"
# elif [ $_tmux_version -gt 280 ]; then
# status_right="#(echo; while [ x\"\$(tmux -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- ~/.tmux.conf | sh -s _uptime; sleep $interval; done)$status_right"
# status_right="#(echo; while [ x\"\$(\"$TMUX_EXECUTABLE\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _uptime; sleep $interval; done)$status_right"
# elif [ $_tmux_version -gt 240 ]; then
# status_right="#(echo; while :; do nice cut -c3- ~/.tmux.conf | sh -s _uptime; sleep $interval; done)$status_right"
# status_right="#(echo; while :; do nice cut -c3- \"$TMUX_CONF\" | sh -s _uptime; sleep $interval; done)$status_right"
# else
# status_right="#(nice cut -c3- ~/.tmux.conf | sh -s _uptime)$status_right"
# status_right="#(nice cut -c3- \"$TMUX_CONF\" | sh -s _uptime)$status_right"
# fi
# ;;
# esac
#
# _pkillf 'cut -c3- ~/\.tmux\.conf \| sh -s _loadavg'
# _pkillf "cut -c3- \"$TMUX_CONF\" \| sh -s _loadavg"
# case "$status_left $status_right" in
# *'#{loadavg'*|*'#{?loadavg'*)
# status_left=$(echo "$status_left" | sed -E \
@ -1329,21 +1353,21 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g')
# interval=$(tmux show -gv status-interval)
# if [ $_tmux_version -ge 320 ]; then
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \$sleep_pid; exit 0' TERM; while [ x\"\$(tmux -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- ~/.tmux.conf | sh -s _loadavg; sleep $interval & sleep_pid=\$!; wait \$sleep_pid; sleep_pid=; done"
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \$sleep_pid; exit 0' TERM; while [ x\"\$(\"$TMUX_EXECUTABLE\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _loadavg; sleep $interval & sleep_pid=\$!; wait \$sleep_pid; sleep_pid=; done"
# elif [ $_tmux_version -gt 280 ]; then
# status_right="#(echo; while [ x\"\$(tmux -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- ~/.tmux.conf | sh -s _loadavg; sleep $interval; done)$status_right"
# status_right="#(echo; while [ x\"\$(\"$TMUX_EXECUTABLE\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _loadavg; sleep $interval; done)$status_right"
# elif [ $_tmux_version -gt 240 ]; then
# status_right="#(echo; while :; do nice cut -c3- ~/.tmux.conf | sh -s _loadavg; sleep $interval; done)$status_right"
# status_right="#(echo; while :; do nice cut -c3- \"$TMUX_CONF\" | sh -s _loadavg; sleep $interval; done)$status_right"
# else
# status_right="#(nice cut -c3- ~/.tmux.conf | sh -s _loadavg)$status_right"
# status_right="#(nice cut -c3- \"$TMUX_CONF\" | sh -s _loadavg)$status_right"
# fi
# ;;
# esac
#
# # -- custom variables ------------------------------------------------------
#
# if [ -f ~/.tmux.conf.local ] && [ x"$(cut -c3- ~/.tmux.conf.local | sh 2>/dev/null -s printf probe)" = x"probe" ]; then
# replacements=$(perl -n -e 'print if s!^#\s+([^_][^()\s]+)\s*\(\)\s*{\s*(?:#.*)?\n!s%#\\\{\1((?:\\s+(?:[^\{\}]+?|#\\{(?:[^\{\}]+?)\}))*)\\\}%#(cut -c3- ~/.tmux.conf.local | sh -s \1\\1)%g; !p' < ~/.tmux.conf.local)
# if [ -f "$TMUX_CONF_LOCAL" ] && [ x"$(cut -c3- "$TMUX_CONF_LOCAL" | sh 2>/dev/null -s printf probe)" = x"probe" ]; then
# replacements=$(perl -n -e 'print if s!^#\s+([^_][^()\s]+)\s*\(\)\s*{\s*(?:#.*)?\n!s%#\\\{\1((?:\\s+(?:[^\{\}]+?|#\\{(?:[^\{\}]+?)\}))*)\\\}%#(cut -c3- \"\\\$TMUX_CONF_LOCAL\" | sh -s \1\\1)%g; !p' "$TMUX_CONF_LOCAL")
# status_left=$(echo "$status_left" | perl -p -e "$replacements" || echo "$status_left")
# status_right=$(echo "$status_right" | perl -p -e "$replacements" || echo "$status_right")
# fi
@ -1363,8 +1387,11 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# tmux_conf_update_plugins_on_reload="$3"
# tmux_conf_uninstall_plugins_on_reload="$4"
#
# TMUX_PLUGIN_MANAGER_PATH=${TMUX_PLUGIN_MANAGER_PATH:-~/.tmux/plugins}
# if [ -z "$(tmux show -gv '@plugin')" ] && [ -z "$(tmux show -gv '@tpm_plugins')" ]; then
# TMUX_PLUGIN_MANAGER_PATH=${TMUX_PLUGIN_MANAGER_PATH:-$(dirname "$TMUX_CONF")/plugins}
# mkdir -p "$TMUX_PLUGIN_MANAGER_PATH"
#
# tpm_plugins=$(tmux show -gvq '@tpm_plugins')
# if [ -z "$(tmux show -gv '@plugin')" ] && [ -z "$tpm_plugins" ]; then
# if _is_true "$tmux_conf_uninstall_plugins_on_reload" && [ -d "$TMUX_PLUGIN_MANAGER_PATH/tpm" ]; then
# tmux display 'Uninstalling tpm and plugins...'
# rm -rf "$TMUX_PLUGIN_MANAGER_PATH"
@ -1372,6 +1399,13 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# fi
# else
# if git ls-remote -hq https://github.com/gpakosz/.tmux.git master > /dev/null; then
# tpm_plugins=$(cat << EOF | tr ' ' '\n' | uniq
# $(printf '%s' "$tpm_plugins")
# $(awk '/^[ \t]*set(-option)?.*[ \t]@plugin[ \t]/ { gsub(/'\''/, ""); gsub(/'\"'/, ""); print $NF }' ~/.config/tmux/tmux.conf.local 2>/dev/null)
# EOF
# )
# tmux set -g '@tpm_plugins' "$tpm_plugins"
#
# if [ ! -d "$TMUX_PLUGIN_MANAGER_PATH/tpm" ]; then
# install_tpm=true
# tmux display 'Installing tpm and plugins...'
@ -1414,7 +1448,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# [ -z "$(tmux show -gqv '@tpm-clean')" ] && tmux set -g '@tpm-clean' 'M-u'
# [ -f "$TMUX_PLUGIN_MANAGER_PATH/tpm/tpm" ] && "$TMUX_PLUGIN_MANAGER_PATH/tpm/tpm" || tmux display "One or more tpm plugin(s) failed"
# if [ $_tmux_version -gt 260 ]; then
# tmux set -gu '@tpm-install' \; set -gu '@tpm-update' \; set -gu '@tpm-clean' \; set -gu '@plugin'
# tmux set -gu '@tpm-install' \; set -gu '@tpm-update' \; set -gu '@tpm-clean' \; set -gu '@plugin' \; set -gu '@tpm_plugins'
# fi
# fi
# }
@ -1423,13 +1457,13 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# tmux_conf_update_plugins_on_launch=${tmux_conf_update_plugins_on_launch:-true}
# tmux_conf_update_plugins_on_reload=${tmux_conf_update_plugins_on_reload:-true}
# tmux_conf_uninstall_plugins_on_reload=${tmux_conf_uninstall_plugins_on_reload:-true}
# tmux run -b "cut -c3- ~/.tmux.conf | sh -s __apply_plugins \"$window_active\" \"$tmux_conf_update_plugins_on_launch\" \"$tmux_conf_update_plugins_on_reload\" \"$tmux_conf_uninstall_plugins_on_reload\""
# tmux run -b "cut -c3- \"$TMUX_CONF\" | sh -s __apply_plugins \"$window_active\" \"$tmux_conf_update_plugins_on_launch\" \"$tmux_conf_update_plugins_on_reload\" \"$tmux_conf_uninstall_plugins_on_reload\""
# }
#
# _apply_important() {
# cfg=$(mktemp) && trap 'rm -f $cfg*' EXIT
#
# if perl -n -e 'print if /^\s*(?:set|bind|unbind).+?#!important\s*$/' ~/.tmux.conf.local 2>/dev/null > "$cfg.local"; then
# if perl -n -e 'print if /^\s*(?:set|bind|unbind).+?#!important\s*$/' "$TMUX_CONF_LOCAL" 2>/dev/null > "$cfg.local"; then
# if ! tmux source-file "$cfg.local"; then
# verbose_flag=$(tmux source-file -v /dev/null 2> /dev/null && printf -- '-v' || true)
# while ! out=$(tmux source-file "$verbose_flag" "$cfg.local"); do

View file

@ -14,9 +14,14 @@ Requirements:
- awk, perl and sed
- outside of tmux, `$TERM` must be set to `xterm-256color`
To install, run the following from your terminal: (you may want to backup your
existing `~/.tmux.conf` first)
⚠️ Before installing, you may want to backup your existing configuration.
You can install Oh my tmux! at any of the following locations:
- `~/.tmux.conf` and `~/.tmux.conf.local`
- `$XDG_CONFIG_HOME/tmux/tmux.conf` and `$XDG_CONFIG_HOME/tmux/tmux.conf.local`
- `~/.config/tmux/tmux.conf` and `~/.config/tmux/tmux.conf.local`
Installing in `~`:
```
$ cd
$ git clone https://github.com/gpakosz/.tmux.git
@ -24,19 +29,27 @@ $ ln -s -f .tmux/.tmux.conf
$ cp .tmux/.tmux.conf.local .
```
💡 You can clone the repository anywhere you want, provided you create the
proper `~/.tmux.conf` symlink and you copy the `.tmux.conf.local` sample file in
your home directory:
Installing in `$XDG_CONFIG_HOME/tmux`:
```
$ git clone https://github.com/gpakosz/.tmux.git /path/to/oh-my-tmux
$ ln -s -f /path/to/oh-my-tmux/.tmux.conf ~/.tmux.conf
$ cp /path/to/oh-my-tmux/.tmux.conf.local ~/.tmux.conf.local
$ git clone https://github.com/gpakosz/.tmux.git "/path/to/oh-my-tmux"
$ mkdir -p "$XDG_CONFIG_HOME/tmux"
$ ln -s "/path/to/oh-my-tmux/.tmux.conf" "$XDG_CONFIG_HOME/tmux/tmux.conf"
$ cp "/path/to/oh-my-tmux/.tmux.conf.local" "$XDG_CONFIG_HOME/tmux/tmux.conf.local"
```
Then proceed to [customize] your `~/.tmux.conf.local` copy.
Installing in `~/.config/tmux`:
```
$ git clone https://github.com/gpakosz/.tmux.git "/path/to/oh-my-tmux"
$ mkdir -p "~/.config/tmux"
$ ln -s "/path/to/oh-my-tmux/.tmux.conf" "~/.config/tmux/tmux.conf"
$ cp "/path/to/oh-my-tmux/.tmux.conf.local" "~/.config/tmux/tmux.conf.local"
```
[customize]: #configuration
Then proceed to [customize] your `.tmux.conf.local` or `tmux.conf.local` copy.
❗️ You should never alter the main `.tmux.conf` / `tmux.conf` file. If you do,
you're on your own. Instead, every customization happens in your
`.tmux.conf.local` or `tmux.conf.local` copy.
If you're a Vim user, setting the `$EDITOR` environment variable to `vim` will
enable and further customize the vi-style key bindings (see tmux manual).
@ -44,6 +57,7 @@ enable and further customize the vi-style key bindings (see tmux manual).
If you're new to tmux, I recommend you read [tmux 2: Productive Mouse-Free
Development][bhtmux2] by [@bphogan].
[customize]: #configuration
[bhtmux2]: https://pragprog.com/book/bhtmux2/tmux-2
[@bphogan]: https://twitter.com/bphogan