1

I was using vim-tmux-navigator and <C-j> had always worked.

One day, I found it doesn't work anymore.

When doing <C-v><C-j>, <C-v><C-m>, <C-v><enter> in command mode, they all give me ^M. However testing on my colleague's Mac, the <C-j> would return ^@ instead.

All I know is:

  1. The plugin maps <NL> and <CR> instead of some specific keystrokes
  2. :verbose map shows nothing suspicious. No <C-j> mappings. Only mapping <NL> and <CR> to :TmuxNavigateDown.

Any ideas? (I am using iTerm2)

3
  • 1
    ^@ is the NULL byte (0x00), which is a weird key code to send Dec 21, 2017 at 11:14
  • Last time I have a weird bug is that all my backslashes needs to be double escaped, and the cause was cpoptions. This time I should be using the default cpoptions.. along with Tmux Navigator not working, my :Tags is using path relative to home instead of the project path (so I can't navigate to a tag..) and every time I edit vimrc it says that I have a swap file... Lemme see if I can make a minimal reproducible case for the <C-j> thing
    – Sunny Pun
    Dec 21, 2017 at 16:30
  • @Carpetsmoker I tried vim -u NONE and :nn <NL> ij<esc> and pressing <C-j> doesn't work, but :nn <C-m> ij<esc> would insert the j when I press <C-j>. How may I carry on any investigation?
    – Sunny Pun
    Dec 22, 2017 at 2:27

1 Answer 1

0

This is indeed a very weird issue. After "fixing", my <C-j> is now returning ^@ and the mapping to <NL> worked.

It should be a Tmux session problem. After turning off tmux and re-attaching the session again, everything is fine.

P.S. for whoever also getting the other issues addressed in the comments, those are really separate issues -- the tags is that I moved tags from project root to .git thus the paths are all wrong; and the vimrc is because there is really a swap file there which is being edited in some halted vim process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.