christoomey / vim-tmux-navigator

Seamless navigation between tmux panes and vim splits
MIT License
5.28k stars 325 forks source link

Using Lazyvim with tmux [navigation stops working with directories other than ~/.config/nvim] #343

Closed shoaibkhanz closed 1 year ago

shoaibkhanz commented 1 year ago

I have noticed a weird navigation issue, where nav works between tmux window and nvim when I have nvim config directory opened, but as soon I open another directory navigation stops working.

TmuxNavigatorProcessList always show (in both cases i.e. working and when not working) Ss -zsh S+ nvim

christoomey commented 1 year ago

I believe this is related to local mappings in Vim being overwritten by the directory functionality. You can check by running :verbose nmap <C-j> or similar in a directory window to see what the mappings currently are. You should see something like:

<C-J>       * :<C-U>TmuxNavigateDown<CR>
        Last set from ~/code/vim/tmux-navigator/plugin/tmux_navigator.vim line 20

But I think the directory plugin may set buffer specific mappings on load.

shoaibkhanz commented 1 year ago

after some looking around the following thread solved the issue https://github.com/LazyVim/LazyVim/discussions/277