Hacker News new | ask | show | jobs
by wwweston 2493 days ago
> It's the default of every IDE I've ever used

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.

3 comments

> How entirely intuitive and not-awkward compared to hitting delete.

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)

> > they are forced to use vim on some remote machine.

> 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.

You can actually just press delete and it will delete a full tab-stop’s worth of spaces.