Closed ycpss91255 closed 4 months ago
You should add a new plugin by following https://github.com/ayamir/nvimdots/wiki/Usage#steps-to-add-a-new-plugin. Then add keymaps by following https://github.com/ayamir/nvimdots/wiki/Usage#modify-keymaps.
Full example for you:
lua/user/plugins/tool.lua
local tool = {}
local in_tmux = function()
return os.getenv("TMUX") ~= nil
end
tool["christoomey/vim-tmux-navigator"] = { lazy = true, cond = in_tmux, cmd = { "TmuxNavigateLeft", "TmuxNavigateDown", "TmuxNavigateUp", "TmuxNavigateRight", "TmuxNavigatePrevious", }, }
return tool
2. `lua/user/keymap/tool.lua`
```lua
local bind = require("keymap.bind")
local map_cu = bind.map_cu
return {
["n|<C-j>"] = map_cu("TmuxNavigateUp"):with_noremap():with_desc("tmux: Navigate Up"),
["n|<C-k>"] = map_cu("TmuxNavigateDown"):with_noremap():with_desc("tmux: Navigate Down"),
}
https://github.com/ayamir/nvimdots/assets/61657399/cba832c2-c9e2-4bea-b5df-ac140f510924
I succeeded, but this configuration also keymaps in environments other than using tmux.
I succeeded, but this configuration also keymaps in environments other than using tmux.
just remove the cond
:
local tool = {}
tool["christoomey/vim-tmux-navigator"] = {
lazy = true,
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
},
}
return tool
Version confirmation
Following prerequisites
Neovim version
NVIM v0.9.4
Branch info
main (Default/Latest)
Minimal (user) folder structure required to reproduce the issue
Minimal config with steps on how to reproduce the issue
plugin/vim-tmux-navigator.lua
config/vim-tmux-navigator.lua
keymap/vim-tux-navigator.lua
Expected behavior
I'm not sure if there is a way to modify the keymap after starting the plugin. I want to make sure I start the plugin in tmux and change the original C-j and C-k to the new function.
Additional information
No response