In my .vimrc I have:
set shiftwidth=4 set tabstop=4 set expandtab
set to use 4 spaces instead of tab when I hit the Tab button. But when I hit backspace after a Tab, I need to backspace all 4 spaces. Is there a way to have it so when I go to backspace a "tab" it can delete all 4 spaces?
In edit mode: One more level, press tab. Going back one level, press backspace. In command mode: arrow keys or h/l. @hlovdal That can also be done by setting softtabstop without having to use actual tab characters in the file.
In short: set et and set noet to switch tab and space as need.
Set 'tabstop' and 'shiftwidth' to whatever you prefer and use 'expandtab'. This way you will always insert spaces. The formatting will never be messed up when 'tabstop' is changed. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use a |modeline| to set these values when editing the file again.
Try set softtabstop=4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With