fix: fixed tmux/vim navigation by adding full paths to ps and grep
parent
4d538fbc8e
commit
720875ddca
|
@ -1,6 +1,9 @@
|
||||||
{ config, pkgs, ... }:
|
{ 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 {
|
in {
|
||||||
programs.tmux = {
|
programs.tmux = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -12,8 +15,8 @@ in {
|
||||||
set -g default-terminal "tmux-256color"
|
set -g default-terminal "tmux-256color"
|
||||||
# set-option -sa terminal-overrides ',alacritty:Tc'
|
# set-option -sa terminal-overrides ',alacritty:Tc'
|
||||||
|
|
||||||
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
is_vim="${ps} -o state= -o comm= -t '#{pane_tty}' \
|
||||||
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
|
| ${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-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'
|
bind -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'select-pane -D'
|
||||||
|
|
Loading…
Reference in New Issue