0

I hate the overwrite mode in VI. I never actually want to overwrite, I just want to hit insert to confirm I am in Insert mode before typing, regardless of what state I was in previously, without worrying I may be toggling overwrite mode instead.

Is there a way to configure vi to never toggle to overwrite mode? So the insert key toggles insert mode always?

I'm using Spacemacs so if someone knows how to do this in Spacemacs that would be best, but failing that if I can get the VI syntax I'm sure I can figure out how to add vi configuration to my Spacemacs config file (I'm pretty new to Spacemacs right now).

  • 3
    Since it's not a question about Unix or Linux, I'd recommend asking it on vi and vim SE or Emacs SE, although if I were you, I would go first to irc and ask there (e.g. freenode). Also remember that cross-posting is bad, so if you go somewhere else, delete the question here(or ask mod to move it) – MatthewRock Nov 14 '16 at 18:01
1

I believe you are referring to Replace Mode. I do not have VI in front of me to test this out. Try if it works for you:

function s:ForbidReplace()
    if v:insertmode isnot# 'i'
        call feedkeys("\<Insert>", "n")
    endif
endfunction
augroup ForbidReplaceMode
    autocmd!
    autocmd InsertEnter  * call s:ForbidReplace()
    autocmd InsertChange * call s:ForbidReplace()
augroup END

This script just flips Replace mode back to Insert. Reference link here.

0

Why are you using your insert key on your keyboard? Just press i. (It will never switch you to replace mode. Worst case it will type the letter "i" and you can press backspace.)

Also, down at the bottom of your vi screen will be a little status bar that says "INSERT" when you are in insert mode.


Emacs and vi are very different, so it's kind of bizarre to see a question asking for a solution equally workable on either.


If you are primarily using insert mode for vi you may want to learn more about Normal Mode.

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.