christoomey / vim-tmux-navigator

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

Nvim -> tmux doesn't work! #356

Closed acezepp83 closed 1 year ago

acezepp83 commented 1 year ago

HI!

Having an issue with the plugin when trying to navigate from NeoVim -> a tmux pane. When I navigate from tmux -> nvim, no problem.

My Setup: I have the plugin installed in both .tmux.conf and plugins.lua. I am using NvChad and the default settings it comes with. It lazy loads the plugin by default. Im running Manjaro Linux, my terminal is alacritty, and my shell is zsh.

I've tried disabling lazy loader which had no effect. I tried updating tmux, nvchad, and my system. I tried restarting nvim, tmux, as well as the terminal itself. Otherwise I've been working around the issue with the mouse.

Following the git guide my output from :TmuxNavigatorProcessList was: S zsh S zsh S zsh S zsh S gitstatusd S nvim

So I opened an issue.

ty

christoomey commented 1 year ago

It's possible that the key mappings are being overwritten by something else in Vim. To rule that out, can you check the output of :verbose nmap <C-h> in vim?

acezepp83 commented 1 year ago

n C-H * C-W h Window Left Last set from Lua

christoomey commented 1 year ago

Yup, looks like you've got a conflicting key mapping. You'll need to hunt that down and remove it (and presumably similar ones for the other directions) from your config and then things should work.

Normally :verbose ... will give more detail, specifically file and line number, so I'm a bit surprised you're not seeing that. As an example, this is what I see:

   <C-H>       * :<C-U>TmuxNavigateLeft<CR>
        Last set from ~/code/vim/tmux-navigator/plugin/tmux_navigator.vim line 19

I'm going to close this now as I believe we've found the issue and you should be able to unstick things, but feel free to comment if you hit any further issues.

jingkeke commented 11 months ago

refer https://github.com/NvChad/NvChad/issues/1984 -- Disable to allow the plugin nvim-tmux-navigator to bind (see custom/plugins.lua)

  M.disabled = {
  n = {
    -- Disable to allow the plugin nvim-tmux-navigator to bind (see custom/plugins.lua)
    ["<C-h>"] = "",
    ["<C-l>"] = "",
    ["<C-j>"] = "",
    ["<C-k>"] = "",
  }
}