From 720875ddca0cb438882c73edfe8aa13aafc54846 Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Sun, 9 Jul 2023 18:29:18 +0200 Subject: [PATCH] fix: fixed tmux/vim navigation by adding full paths to ps and grep --- home/tmux/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/home/tmux/default.nix b/home/tmux/default.nix index a2a6d33..840a4e4 100644 --- a/home/tmux/default.nix +++ b/home/tmux/default.nix @@ -1,6 +1,9 @@ { config, pkgs, ... }: -let tmux = "${pkgs.tmux}/bin/tmux"; +let + tmux = "${pkgs.tmux}/bin/tmux"; + ps = "${pkgs.procps}/bin/ps"; + grep = "${pkgs.gnugrep}/bin/grep"; in { programs.tmux = { enable = true; @@ -12,8 +15,8 @@ in { set -g default-terminal "tmux-256color" # set-option -sa terminal-overrides ',alacritty:Tc' - is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ - | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" + is_vim="${ps} -o state= -o comm= -t '#{pane_tty}' \ + | ${grep} -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" bind -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'select-pane -L' bind -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'select-pane -D'