diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 3918b95..14de334 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -44,9 +44,14 @@ set -g base-index 1 # Numbering of windows setw -g pane-base-index 1 # Numbering of Panes set -g mouse on +set-option -gw xterm-keys on 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-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 # 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)?$'" bind-key -n 'S-Left' if-shell "$is_vim" 'send-keys S-Left' 'select-pane -L'