From a1b422e29ecc5f678e256a1b9897ccde7af97f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Mon, 19 Feb 2024 15:43:17 +0100 Subject: [PATCH] feat(tmux): add second prefix for nested in ssh --- tmux/tmux-ssher | 2 +- tmux/tmux.conf | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/tmux/tmux-ssher b/tmux/tmux-ssher index 7893ca5..8427fd9 100755 --- a/tmux/tmux-ssher +++ b/tmux/tmux-ssher @@ -3,7 +3,7 @@ if [[ $# -eq 1 ]]; then selected=$1 else - selected=$(grep "Host .*" ~/.ssh/config | grep -v "*" | sed "s/Host \(.*\)/\1/" | fzf --cycle --bind 'tab:toggle-up,btab:toggle-down') + selected="$(grep 'Host .*' ~/.ssh/config | grep -v '*' | sed 's/Host \(.*\)/\1/' | fzf --cycle --bind 'tab:toggle-up,btab:toggle-down')" fi if [[ -z $selected ]]; then diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 8eabe85..c342fe2 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -5,9 +5,7 @@ set -s escape-time 0 set-option -g focus-events on -unbind C-b -set-option -g prefix C-s -bind-key C-s send-prefix +set-option -g prefix2 C-s bind r source-file "$XDG_CONFIG_HOME/tmux/tmux.conf" set -g base-index 1 @@ -28,15 +26,15 @@ if-shell -b '[ "$(uname -s)" = "Darwin" ]' { } # vim-like pane switching -bind -r ^ last-window -bind -r k select-pane -U -bind -r j select-pane -D -bind -r h select-pane -L -bind -r l select-pane -R +bind ^ last-window +bind k select-pane -U +bind j select-pane -D +bind h select-pane -L +bind l select-pane -R -bind-key -r f run-shell "tmux neww ~/.config/tmux/tmux-sessionizer" -bind-key -r F run-shell "tmux neww ~/.config/tmux/tmux-ssher" -bind-key -r T run-shell "tmux neww ~/.config/tmux/tmux-sessionizer ~/temp" -bind-key -r R run-shell "tmux neww ~/.config/tmux/tmux-sessionizer ~" -bind-key -r G run-shell "tmux neww ~/.config/tmux/tmux-ggclone" +bind-key f run-shell "tmux neww ~/.config/tmux/tmux-sessionizer" +bind-key F run-shell "tmux neww ~/.config/tmux/tmux-ssher" +bind-key T run-shell "tmux neww ~/.config/tmux/tmux-sessionizer ~/temp" +bind-key R run-shell "tmux neww ~/.config/tmux/tmux-sessionizer ~" +bind-key G run-shell "tmux neww ~/.config/tmux/tmux-ggclone"