Dan
Dan

Reputation: 3725

vim: Moving cursor to beginning/end of insertion

While in insert mode, is it possible to move to the beginning/end of the insertion?

Just to clarify I'm NOT asking how to move to the start of the line, paragraph, or word.

Since vim disables backspace beyond insertion, depending on backspace mode, it must know where the insertion begins and ends, right?

Upvotes: 0

Views: 243

Answers (1)

Brett Y
Brett Y

Reputation: 7678

How about:

<ctrl-o>`[

<ctrl-o> allows you to perform one normal mode command before going back into insert mode.


After the comments below I realise you will need to set a mark as you enter insert mode

nnoremap i mii

or

autocmd! InsertEnter * :normal mi

(Although the autocmd won't work properly when entering insert mode not using i)

You can then go back to where you entered insert mode using

<crtl-o>`i

Upvotes: 2

Related Questions