1
0

cleanup tmux config

This commit is contained in:
2025-02-13 23:00:02 +01:00
parent 2051d66b8e
commit 4ca00b7aac

View File

@@ -44,9 +44,14 @@ set -g base-index 1 # Numbering of windows
setw -g pane-base-index 1 # Numbering of Panes setw -g pane-base-index 1 # Numbering of Panes
set -g mouse on set -g mouse on
set-option -gw xterm-keys on
bind-key -n C-t new-window bind-key -n C-t new-window
bind-key -n C-S-T new-window -c '#{pane_current_path}' bind-key -n C-S-t new-window -c '#{pane_current_path}'
# Pane splits should open to the same path as the current pane
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind-key -n C-S-Down next-window bind-key -n C-S-Down next-window
bind-key -n C-S-Up previous-window bind-key -n C-S-Up previous-window
@@ -59,13 +64,7 @@ bind-key -n C-S-Right swap-window -t +1\; select-window -t +1
setw -g mode-keys vi setw -g mode-keys vi
# decide whether we're in a Vim process # decide whether we're in a Vim process
#is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
is_vim="~/.is_vim.sh '#{pane_tty}'" is_vim="~/.is_vim.sh '#{pane_tty}'"
# is_vim="children=(); i=0; pids=( $(ps -o pid=,tty= | grep -iE '#{s|/dev/||:pane_tty}' | awk '\{print $1\}') ); \
# while read -r c p; do [[ -n c && c -ne p && p -ne 0 ]] && children[p]+=\" $\{c\}\"; done <<< \"$(ps -Ao pid=,ppid=)\"; \
# while (( $\{#pids[@]\} > i )); do pid=$\{pids[i++]\}; pids+=( $\{children[pid]-\} ); done; \
# ps -o state=,comm= -p \"$\{pids[@]\}\" | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'S-Left' if-shell "$is_vim" 'send-keys S-Left' 'select-pane -L' bind-key -n 'S-Left' if-shell "$is_vim" 'send-keys S-Left' 'select-pane -L'