In the editor it'd be really nice if the tab key is trapped with JavaScript and is transferred to 4 space or similar so when I try to indent my code I can do it with one key. We have the code button but once that is applied it'd be nice to be able to style/indent the internal blocks easily.

(Hope that's not duplicate but even if it's it shows the need of such functionality)

  • 3
    @ChrisF the difference is I don't want to convert pasted TABs rather want to be able to press TAB while editing and that get translated to 4 spaces so the link you've posted is not quite relevant. – infinity Nov 10 '12 at 11:40
  • I've posted a related discussion. – J.Todd Jun 25 '14 at 0:06

No. Very much no.

The Tab key's behavior is very well-defined in a browser: It tabs you out of the editor box. Going with your feature request would mean killing functionality that everybody expects from their browser. This is not going to happen.

I have created a user script offering the kind of functionality you want (check it out if you're a user script kind of person), and even there I added a way to go back to native tab behavior.

As you'll notice, that way is somewhat awkward. There really isn't a way to make Tab behave in both ways simultaneously, since they obviously contradict each other.

The "press and release Ctrl before pressing Tab" hack (or something along those lines) is okay for someone consciously making the decision to install a user script. But not for the core functionality of a website.

  • An alternative would be replace the {} with indent and unindent buttons, though I realise that might be quite a 'radical' change... – Benjol Jan 24 '13 at 6:14
  • 1
    Why not make it a user preference, off by default? – Zev Spitz Apr 2 '17 at 5:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .