I have the following in my
nnoremap <C-J> o<Esc>k$ nnoremap <C-K> O<Esc>j$
The bottom mapping works as expected, but
c-j now produces the same effect as
i (which is really dumb). To troubleshoot, I tried:
verbose map c-j " UPDATE: the above is wrong. Instead use: verbose map <c-j> verbose map <buffer>
The top command returns
nothing (see last update), and the bottom nothing relevant. How can I find out what's wrong?
Update. Someone said this is a duplicate of this post, but I don't understand how. For what it's worth, I got the idea for the mapping from the vim wiki, so it must've worked for some people. In fact, it was working for me, too, before it stopped. Also, according to the help,
c-j is supposed to be the same as
<nl>, but that's not the case here as I said earlier. It behaves like
i, and I would like to know how to figure out why.
Update II. The mapping now works fortuitously after the following change. If there's a decent explanation, I'll accept it as answer. Otherwise, I'm happy enough to get this to work.
" old " nnoremap <CR> :noh<CR><CR> " new nnoremap <CR> :noh<return>
Update III. It's not working again, but I now realize that my
verbose map syntax above is incorrect. The correct syntax gives me something to work with. Thanks all.