Tabbed spaces and backspace in Vim

In my .vimrc, I have:

set shiftwidth=4 set tabstop=4 set expandtab 

set to use 4 spaces instead of tabs when I press the Tab button. But when I press backspace after Tab, I need to cancel all 4 spaces. Is there a way to have this, so when I go to the backspace "tab" it can remove all 4 spaces?

+49
vim
Nov 11 2018-10-11T00:
source share
3 answers

Try set softtabstop=4

+71
Nov 11 2018-10-11T00:
source share

You can try using ^ T and ^ D.

 :help i_CTRL-T :help i_CTRL-D 

They allow you to insert or delete (more similar to backspace), and the number of spaces is equal to the width.

+6
Mar 04 '12 at 23:24
source share

I have the same problem with you as before, but soon I found that it does not make sense to just return 1 character in real encoding. but if you really need 1 space backspace, you can just enter another space, then you can only delete one character each time you press the spacebar, even if you got where you typed the 4 spaces tab

0
Nov 28 '14 at 8:10
source share



All Articles