diff options
| author | stefan <stefan@s00.xyz> | 2025-05-20 15:17:01 -0400 |
|---|---|---|
| committer | stefan <stefan@s00.xyz> | 2025-05-20 15:17:01 -0400 |
| commit | 92fe04a180e3cfca16c3ef4150a5a1eec879b665 (patch) | |
| tree | be66d0ea3bafed01bec10bb286f6964703bcfb72 /modules/tmux/default.nix | |
| parent | 2d701706abcc131aea8b2758cfff0acdc18a4b74 (diff) | |
| download | home-92fe04a180e3cfca16c3ef4150a5a1eec879b665.tar.gz | |
(form) sync
Diffstat (limited to 'modules/tmux/default.nix')
| -rw-r--r-- | modules/tmux/default.nix | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/modules/tmux/default.nix b/modules/tmux/default.nix index b14563b..318e1db 100644 --- a/modules/tmux/default.nix +++ b/modules/tmux/default.nix @@ -38,6 +38,13 @@ in set -g @continuum-restore 'on' ''; } + # { + # plugin = vim.tmux-navigatior; + # extraConfig = '' + # set -g + # ''; + # } + ]; extraConfig = '' set -g default-terminal "screen-256color" @@ -78,10 +85,18 @@ in bind e select-pane -U bind i select-pane -R + is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?\.?(view|l?n?vim?x?|fzf)(diff)?(-wrapped)?$'" + + bind-key -n 'M-m' if-shell "$is_vim" 'send-keys M-m' 'select-pane -L' + bind-key -n 'M-n' if-shell "$is_vim" 'send-keys M-n' 'select-pane -D' + bind-key -n 'M-e' if-shell "$is_vim" 'send-keys M-e' 'select-pane -U' + bind-key -n 'M-i' if-shell "$is_vim" 'send-keys M-i' 'select-pane -R' + bind-key -T root m if -F "#{==:#{pane_mode},tree-mode}" "send h" "send m" bind-key -T root n if -F "#{==:#{pane_mode},tree-mode}" "send j" "send n" bind-key -T root e if -F "#{==:#{pane_mode},tree-mode}" "send k" "send e" - bind-key -T root i if -F "#{==:#{pane_mode},tree-mode}" "send l" "send i;" + bind-key -T root i if -F "#{==:#{pane_mode},tree-mode}" "send l" "send i" bind -T copy-mode-vi m send-keys -X cursor-left bind -T copy-mode-vi n send-keys -X cursor-down |