Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you delete old text in Insert Mode in GVIM

Tags:

vim

I've just downloaded GVIM for the PC and MacVIM for the Mac and they both have different behaviour to the VIM I was using in MSYS.

Here's the problem. I bring up a file in VIM and enter insert mode. I can no longer delete any of old text. I can insert new text and delete them just fine so I know my backspace and delete keys are working. What's even more annoying that if I move the cursor to another line and come back to my original one, the new text I've typed becomes undeletable as well.

The command line VIM allows me to delete old text in insert mode but the GUI versions do not. I've looked in the options and googled but have not come up with anything.

Does anyone know how I can make the GUI version behave like the command line version of VIM?

like image 499
Cthutu Avatar asked Aug 28 '10 02:08

Cthutu


1 Answers

Check the output of

:set backspace?

It will likely say something like

backspace=indent,eol

This means you can hit backspace to delete over end of line and indent characters. To be able to delete text that was present before you went into insert mode, you need to add 'start'.

:set backspace=indent,eol,start

This is equivalent to

:set backspace=2

For more details see

:help 'backspace'
like image 175
michaeltwofish Avatar answered Sep 19 '22 14:09

michaeltwofish