I don't think <ctrl-J>
and Enter
are same. In vim, <ctrl-j>
has keycode 10, but Enter
has 13.
There are some equivalent keys, e.g.
<ctrl-M> and Enter
<ctrl-H> and backspace
<ctrl-[> and ESC
...
you can test in your vim, <ctrl-M>
and Enter
does the same thing, no matter which mode are you in.
Actually, there is another key combination, which is also hard to distinguish with <Enter>
and <Ctrl-M>
. it is <C-Enter>
I don't know what you want to achieve, you said you want to do some terminal development (ncurses), if the terminal even cannot distinguish those keys, you can just leave it. I don't have experience of ncurses, don't be mad if I was wrong. ^_^
if you type :h keycodes
you can see more information, the table below was copied from vim help.
notation meaning equivalent decimal value(s) ~
-----------------------------------------------------------------------
<Nul> zero CTRL-@ 0 (stored as 10) *<Nul>*
<BS> backspace CTRL-H 8 *backspace*
<Tab> tab CTRL-I 9 *tab* *Tab*
*linefeed*
<NL> linefeed CTRL-J 10 (used for <Nul>)
<FF> formfeed CTRL-L 12 *formfeed*
<CR> carriage return CTRL-M 13 *carriage-return*
<Return> same as <CR> *<Return>*
<Enter> same as <CR> *<Enter>*
<Esc> escape CTRL-[ 27 *escape* *<Esc>*
<Space> space 32 *space*
<lt> less-than < 60 *<lt>*
<Bslash> backslash \ 92 *backslash* *<Bslash>*
<Bar> vertical bar | 124 *<Bar>*
<Del> delete 127
<CSI> command sequence intro ALT-Esc 155 *<CSI>*
<xCSI> CSI when typed in the GUI *<xCSI>*