Reputation: 695
When i press <C-Right>
in insert mode, vim does the same thing that it would being in normal mode and pressing w. But i would like to remap C-Right and C-Left so the effect would be more like the e key (specially at the end of a line, when i'm just before the last word i don't want vim to skip the line and go to the next line word, i want it to put the cursor just at the end of the line.)
I tried for the insert mode :inoremap <C-Right> <Esc> e a
but it keeps jumping the line, besides <Esc> e a
doing exactly what i want.
In normal mode, :nnoremap <C-Right> E
does what i want.
What i am missing to make the remap work?
Thank you for your time reading the question.
Upvotes: 0
Views: 606
Reputation: 31459
Don't put spaces inbetween the commands (or after them). All the spaces count as part of the command (which is move the cursor to the right)
:inoremap <C-Right> <Esc> e a
should be
:inoremap <C-Right> <Esc>ea
Upvotes: 1