diff --git a/bin/bin/is_vim b/bin/bin/is_vim new file mode 100755 index 0000000..a47980b --- /dev/null +++ b/bin/bin/is_vim @@ -0,0 +1,8 @@ +#!/usr/bin/env fish + +set tty (echo "$argv[1]" | cut -d/ -f3-) + +for pid in (pgrep -t $tty) + set exe (readlink /proc/$pid/exe 2>/dev/null || cat /proc/$pid/cmdline | tr '\0' '\n' | grep -E '^[^-]' | sed -n '2p') + echo (ps -o state= -p $pid) $exe +end | grep -iqE '^[^TXZ ] +(.*/)?(view|n?vim?x?)(-wrapped)?(diff)?$' diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf index 96f12c8..057f8f2 100644 --- a/tmux/.config/tmux/tmux.conf +++ b/tmux/.config/tmux/tmux.conf @@ -103,6 +103,8 @@ bind -T off -n M-q { # disable nord status bar set -g @nord_tmux_show_status_content '0' +set -g @tmux-nvim-condition "is_vim '#{pane_tty}'" + set -g @tmux-nvim-navigation true set -g @tmux-nvim-navigation-cycle true set -g @tmux-nvim-navigation-keybinding-left 'M-h'