Which is probably not every IDE or editor.
> I press shift+tab, it deletes 4 spaces.
How entirely intuitive and not-awkward compared to hitting delete.
> they are forced to use vim on some remote machine.
Vim is not exactly unpopular as an editor of choice.
But overarching all that -- the ;) at the end of my comment should have been a clue that I was not sincerely arguing that figuring out how to use spaces for tabs is an involved task. Even somebody using vim (whether forced or by choice) should know `:set expandtab`. Most editors worth investing in will provide a convenient way of doing this.
Rarer are the editors that will also let you change indentation width on the fly while expanding tabs to spaces, though, which is generally easy if you use tab characters for indentation. I'm not super familiar with VSCode, but having just fired it up and tried it out, maybe it can do this if you turn on Detect Indentation, though it doesn't seem to be the default, and I haven't put it through the paces for less trivial cases.
Try it, you'll like it. Especially when you want to untab an entire block of code instead of just one line.
- Highlight entire block of code
- shift+tab unindents entire block (whereas delete would delete entire block)
Plus, once you know a lot of shortcuts, `shift` seems to be sort of a negating key so it actually starts to be intuitive. (i.e. in vim, if you are searching for a string, "n" will move to next match, "shift+n" will move to previous match)
> Vim is not exactly unpopular as an editor of choice.
I think by "some remote machine" he's implying "default configuration", because vim can be configured to insert spaces; I would know, I have mine set up that way.
My PhD advisor does... His preferred editor is vi (not vim, but vi)
Totally, hazard pay factor. ;)
..but I do it because of habits learned in python shell and also because of that cowboy character on the Simpsons cartoon that called himself OCD about the number 4 and then counted 1,2,3,4 tapping his foot and shooting his gun into the air.
Even then, you can just use >> and << in vim; as long as it's set up correctly it'll insert spaces.
Works with whole sections in visual mode too ("v, down, down, down, >" will indent four lines).
You don't have to "figure out" anything. It's the default of every IDE I've ever used.
I press tab, VSCode inserts 4 spaces. I press shift+tab, it deletes 4 spaces.
Nobody actually presses spacebar 4 times to indent unless they are forced to use vim on some remote machine.