Closed jaikb closed 3 months ago
I had same issue. I fixed it with setting lazy to false and changing "config" to "init". That's my current config:
return {
"christoomey/vim-tmux-navigator",
lazy = false,
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
},
init = function()
-- local nav = require("nvim-tmux-navigator")
local map = vim.keymap.set
map("n", "<c-h>", "<cmd>TmuxNavigateLeft<cr>")
map("n", "<c-j>", "<cmd>TmuxNavigateDown<cr>")
map("n", "<c-k>", "<cmd>TmuxNavigateUp<cr>")
map("n", "<c-l>", "<cmd>TmuxNavigateRight<cr>")
map("n", "<c-\\>", "<cmd>TmuxNavigatePrevious<cr>")
end,
}
Hi @jaikb,
I am using NvChad as well. If you run :Telescope keymaps and search c-h
, you will find the command was successfully bound to "ov" modes. I guess the configuration was good, but other key settings from plugins/code in NvChad were set after lazy. I removed line 21 to 24 from core/mappings.lua
and everything works perfectly now.
Note: Ideally we shouldn't change any files not in custom
folder, but I don't know how to avoid overwriting keymaps.
HTH.
Hey @alex-fu-cn thanks for the detailed notes there. I believe you found the source of the issue (conflicting key bindings coming from other NvChad config/plugins). I’m going to close this now with that context.
Followed all the instructions in the
README.md
and the way I did it was make aplugins.lua
file in.config/nvim/lua/custom
folder where I have this:Then in my
chadrc.lua
file I haveM.plugins = 'custom.plugins'
and it installs the plugin using Lazy, but the keybinds won't let me go from NeoVim to the TMUX pane. Any help?