christoomey / vim-tmux-navigator

Seamless navigation between tmux panes and vim splits
MIT License
5.07k stars 319 forks source link

:TmuxNavigatorProcessList output missing tmux #350

Closed n-tropy247 closed 1 year ago

n-tropy247 commented 1 year ago

Hello, I'm trying to troubleshoot the plugin not working to switch panes while in neovim. I installed the tmux plugin via TPM and the nvim plugin via vim-plug. The vim command suggested in the Troubleshooting section of the readme produced: S zsh S nvim

OS: Ubuntu 22.04.2 LTS on Windows 10.0.22621 x86_64 Kernel: 5.15.90.1-microsoft-standard-WSL2 Tmux version: 3.2a Neovim version: 0.9.0-dev-781

christoomey commented 1 year ago

Can you confirm the tmux & vim keybindings you have configured? tmux list-keys and nmap in vim will get the relevant lists which should contain some tmux-navigator stuff, but worth double checking.

Also, does tmux navigation work, just not in neovim?

n-tropy247 commented 1 year ago

tmux: bind-key -T root C-h if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-h" "select-pane -L"

bind-key -T root C-j if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-j" "select-pane -D"

bind-key -T root C-k if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-k" "select-pane -U"

bind-key -T root C-l if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-l" "select-pane -R"

neovim: ["<C-h>"] = { "<C-w>h", "window left" }, ["<C-l>"] = { "<C-w>l", "window right" }, ["<C-j>"] = { "<C-w>j", "window down" }, ["<C-k>"] = { "<C-w>k", "window up" },

Also, does tmux navigation work, just not in neovim?

Yes, it works outside of neovim.

christoomey commented 1 year ago

The tmux portion looks right, but the neovim bit looks like it doesn't have the configuration. Just to confirm, do you have the vim plugin installed? It's also possible the vim keybindings are defined but are being overwritten by another part of your config. You can use :verbose nmap <C-h> to look up where the key mapping is set to debug that.

n-tropy247 commented 1 year ago

That sent me down a deep rabbit hole with my system configuration, incredibly sorry for the delayed reply! My journey ended with a complete reinstall of my system and I think its safe to say this one is user error because its all working now. Sorry to trouble you!

christoomey commented 1 year ago

My journey ended with a complete reinstall of my system

The things we'll do for a working dev environment 🙂 Glad it's all sorted for you now.