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

Compare commits

...

2 commits

View file

@ -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 source \"$TMUX_CONF\" && tmux display \"$TMUX_CONF sourced\""
# reload configuration
bind r source-file "$TMUX_CONF" \; display '#{TMUX_CONF} sourced'
bind r source-file "$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 -----------------------------------------------------------------
@ -143,7 +143,7 @@ bind P choose-buffer # choose which buffer to paste from
# -- 8< ------------------------------------------------------------------------
%if #{==:#{TMUX_EXECUTABLE},}
run 'tmux set-environment -g 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" || printf tmux)'
run 'tmux set-environment -g 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)'
%endif
%if #{==:#{TMUX_CONF},}
run 'tmux 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)'
@ -178,7 +178,7 @@ run 'cut -c3- "#{TMUX_CONF}" | sh -s _apply_configuration'
#
# 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; {" || printf tmux)
# 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"