I am aware of the startinsert command which switch to insert mode as if the i key was pressed. With the ! it behaves like A.

Do you know if there is some kind of option to go to insert mode like we press the a key?

1 Answer 1


Here is a workaround with manually detecting if the cursor is at the end of the line :

if col('.') == col('$') - 1
    startinsert! " `A`
    normal l     " `l`
    startinsert  " `i`

col('$') is the last column + 1 so if the cursor is at the end of the line we must substract 1.

reference : https://stackoverflow.com/a/19544043/2558252 (thanks to the robert-audi comment)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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