I use an example of javascript code:
1 var a = 1;
2 var b = |{};
The cursor is at the position of |
( on the character "{" when the cursor shape is block), I find out that I want a
should be assigned an object, so I want to modify it like below:
1 var a = {};
So I want to know when cursor is on "{", how to quickly delete all the contents before "{" until the blank after the "=" sign at line 1?
In other normal editors, I'll just press backspace key to delete the code. But I don't how to achieve this in vim.
i
and use the backspace key. No body will shoot you for that. I think.eol
then backspace will delete line breaks. You'll also needstart
to be included in the setting. (See:help backspace
). Don't use this method though! There are several much faster methods detailed in the answers below.