Open stepanzak opened 5 months ago
PS: My english is not very great, please feel free to reword the sentences I used in the README.
Hey,
Thanks for opening a pull request!
Couple of things:
instead of:
{
"<C-h>",
function()
require("nvim-tmux-navigation").NvimTmuxNavigateLeft()
end,
desc = "Move one nvim/tmux pane to the left",
},
you can probably directly specify:
{
"<C-h>",
require("nvim-tmux-navigation").NvimTmuxNavigateLeft
desc = "Move one nvim/tmux pane to the left",
},
though I haven't tried it.
this is not true:
-- You don't have to include the "config" function if it's empty.
-- config = function()
-- require("nvim-tmux-navigation").setup()
-- end,
as per the README, you do have to call the setup()
method at least once, even if empty (see the Note right at the end of this section.
Have a good one!
I looked at some other examples and I think the best way is to use cmd
and then <cmd>NvimTmuxNavigateSomewhere<cr>
. I did it like that in the new commit, and it's almost the same way as https://github.com/christoomey/vim-tmux-navigator does it. One thing I'm not sure about is that christoomey/vim-tmux-navigator uses <C-U>
in the bindings for some reason:
{
"christoomey/vim-tmux-navigator",
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
},
keys = {
{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
},
}
I don't know why should <C-U>
be there and my neovim tells me that I don't have any binding for <C-U>
when I try to use it.
The config I used in the first commit worked without the config
function, but this one doesn't, so I removed that comment.
It's a native way of Lazy.nvim to add keymaps and it has multiple advantages.