Possible Duplicates:
The Editor - Possible Improvements
Add increase/decrease tab indent buttons to the editor toolbar

Is it at all possible to have the Tab key insert 4 spaces in the question/answer edit area, instead of moving focus to the next control?

When writing code in questions or answers I could really use such functionality, especially for hierarchically indented code, like this:


What I usually do is copy 4 spaces and then paste them over and over again, but using Tab is more natural (I actually do it by mistake quite often).

I think the usage of Tab for moving focus while editing a question/answer is minimal, and its benefits are insignificant versus the benefits of allowing Tabbed code.

A "neater" feature will be to push not 4 spaces but the differences between the next multiple of 4 and the current amount of spaces in the line (e.g. if I pressed once on space and then Tab, the Tab will insert 3 spaces, like "real" tabulation)

  • Dupe: meta.stackexchange.com/questions/493/… Commented Sep 4, 2009 at 10:46
  • 2
    @John: I do think this is a specific feature request that can be accepted or rejected by SO team (and commented on by the community), whereas the question you are referring to is more of a CW request to add ideas to the editor.
    – Roee Adler
    Commented Sep 4, 2009 at 11:01
  • 2
    Then take that one: meta.stackexchange.com/questions/8144/… Commented Sep 4, 2009 at 11:09
  • @John: got it. I tried deleting the question but can't since it has an upvoted answer. Will wait for the moderators to do it.
    – Roee Adler
    Commented Sep 4, 2009 at 11:13
  • As much as I'd like this personally, I don't think over-riding the tab key is a good idea because it makes it harder to use the site sans-mouse, which can be a real pain for some users. The toolbar buttons would help tremendously, though. Commented Sep 4, 2009 at 14:03
  • 1
    or better yet, DO override the tab button, but make it opt in. click a button that turns "tab lock" on so the user can choose to add the functionality if they wish. i can't believe this has been a known issue since 09 and it's not fixed yet.
    – Jason
    Commented May 5, 2012 at 4:13

1 Answer 1


If you have Tab locked in the edit/content window, how will you tab out of it again? Totally breaks the experience of a usable interface.

Can you not just type up your fancy-schmancy code in a plain text editor, making use of its tabbing behaviour and then bring it over?

  • 3
    I understand your point but disagree it's more important than the editor usability for code input. And I actually use Notepad for most of my code snippets :)
    – Roee Adler
    Commented Sep 4, 2009 at 11:03
  • They already broke expected behaviour with the return key in the comments textarea, I'm sure one more infraction wouldn't go amiss - I only say this as a neutral by-stander :)
    – Kev
    Commented Feb 7, 2012 at 20:03
  • 2
    So make the Tab work this way only when something is highlighted. When there is no highlight, Tab acts as usual to leave the field forward or backward (with shift).
    – ErikE
    Commented Nov 28, 2012 at 21:45

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