0

Coming from emacs, jumping to the end of the line is easy:

CTRL + E

I have been recently trying out Vim, and I found out you need to first exit insert mode to then use commands.

So, in Vim, I need to:

  • go to normal mode: <Esc>
  • jump to end of line: $
  • go to insert mode: i

Is there any way to automate this?

  • 1
    Note there are more commands to go to insert mode than just i; for example A will put the cursor at the end of the line and go to insert mode, o opens a new line, etc. See :help inserting for a complete list and docs. – Martin Tournoij Mar 20 at 9:42
3

If your terminal has support, you can simply press End.

Otherwise, use CtrlO to get into normal mode for a single command only. So Ctrl-O and then $ (or A) will do the trick.

In principle, you can remap Ctrl-E to do Ctrl-O $ (like inoremap <c-e> <c-o>$), but :h i_ctrl-e is sometimes useful in Vim on its own.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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