From 8af69312b11c570744eace0e989350728b89d70a Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Thu, 6 Jul 2023 13:10:22 +0200 Subject: [PATCH] Update tmux conf to work with fzf and nvim --- tmux.conf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tmux.conf b/tmux.conf index ba10d8f..a76feb2 100644 --- a/tmux.conf +++ b/tmux.conf @@ -9,6 +9,15 @@ if "test ! -d ~/.tmux/plugins/tpm" \ # Activate the plugins. run -b "~/.tmux/plugins/tpm/tpm" +# VIM and FZF navigation bindings +is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" +is_fzf="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?fzf$'" +bind -n C-h run "($is_vim && tmux send-keys C-h) || tmux select-pane -L" +bind -n C-j run "($is_vim && tmux send-keys C-j) || ($is_fzf && tmux send-keys C-j) || tmux select-pane -D" +bind -n C-k run "($is_vim && tmux send-keys C-k) || ($is_fzf && tmux send-keys C-k) || tmux select-pane -U" +bind -n C-l run "($is_vim && tmux send-keys C-l) || tmux select-pane -R" +bind -n 'C-\' if-shell "$is_vim" "send-keys C-\\" "select-pane -l" + set-option -g status-position bottom set-option -g default-terminal "screen-256color" set-option -sa terminal-features ',xterm-256color:RGB'