Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Not an editor command: ^UTmuxNavigateRight" after changing keys table in lazy.nvim #397

Open
istrupin opened this issue Jun 29, 2024 · 3 comments

Comments

@istrupin
Copy link

Hello! I just got turned onto this plugin, and the default configuration seems to work great!

However, I already have my <C-h/j/k/l> keys bound, so I wanted to switch my key bindings on the neovim side to the standard <c-w>h/j/k/l that I've been using.

When I try to set this in lazy.nvim's keys table, I receive the "E492: Not an editor command: ^UTmuxNavigateRight" error whenever I try to navigate (the error changes for right/left/up/down).

My config looks like this:

return {
    "christoomey/vim-tmux-navigator",
    cmd = {
        "TmuxNavigateLeft",
        "TmuxNavigateDown",
        "TmuxNavigateUp",
        "TmuxNavigateRight",
        "TmuxNavigatePrevious",
    },
    keys = {
        { "<c-w>h", "<cmd><C-U>TmuxNavigateLeft<cr>" },
        { "<c-w>j", "<cmd><C-U>TmuxNavigateDown<cr>" },
        { "<c-w>k", "<cmd><C-U>TmuxNavigateUp<cr>" },
        { "<c-w>l", "<cmd><C-U>TmuxNavigateRight<cr>" },
        { "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" }
    },
}

@christoomey
Copy link
Owner

Hmm, I'm not certain as I'm not yet on neovim / lazy.nvim, but I think the <C-U> might be causing the issue. Can you try without the <C-U> in the keys table?

@istrupin
Copy link
Author

istrupin commented Jul 2, 2024

Thanks so much for getting back to me so quickly!

That did indeed seem to solve the problem for me! Interesting that the <C-U> didn't mess up the behavior of the original h/j/k/l mappings in the readme at all.

I also tried the original h/j/k/l mappings without the <C-U> and those worked too!

I'm curious -- what's the purpose of the <C-U> in the readme mappings?

Anyway, I really appreciate the help!

@vimkim
Copy link

vimkim commented Jul 21, 2024

I had the same issue. After deleting the it started working well. I am also curious about the purpose of prepending . I appreciate the nice plugin!

Mine is for lazy.nvim + colemak users

  {
    "christoomey/vim-tmux-navigator",
    cmd = {
      "TmuxNavigateLeft",
      "TmuxNavigateDown",
      "TmuxNavigateUp",
      "TmuxNavigateRight",
      "TmuxNavigatePrevious",
    },
    keys = {
      { "<c-h>", "<cmd>TmuxNavigateLeft<cr>" },
      { "<c-n>", "<cmd>TmuxNavigateDown<cr>" },
      { "<c-e>", "<cmd>TmuxNavigateUp<cr>" },
      { "<c-i>", "<cmd>TmuxNavigateRight<cr>" },
      { "<c-\\>", "<cmd>TmuxNavigatePrevious<cr>" },
    },
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants