1
0

fixes and improvements

This commit is contained in:
2025-02-13 20:23:23 +01:00
parent 6136857a05
commit d063a5461c
8 changed files with 112 additions and 70 deletions

View File

@@ -29,8 +29,8 @@ set -g @tmux_window_name_shells "['bash', 'fish', 'sh', 'zsh']"
set -g @tmux_window_dir_programs "['nvim', 'vim', 'vi', 'git']"
set -g @tmux_window_name_use_tilde "True"
set -g @tmux_window_name_max_name_len "100"
set-option -g default-shell $SHELL
set -g default-command "$SHELL -i"
# set-option -g default-shell $SHELL
# set -g default-command "$SHELL -i"
# Other examples:
# set -g @plugin 'github_username/plugin_name'
@@ -61,8 +61,12 @@ setw -g mode-keys vi
# 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="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)?$'"
is_vim="~/is_vim.sh '#{pane_tty}'"
bind-key -n 'S-Left' if-shell "$is_vim" 'send-keys S-Left' 'select-pane -L'
bind-key -n 'S-Down' if-shell "$is_vim" 'send-keys S-Down' 'select-pane -D'