What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 150 Stack Exchange communities.

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)

share|improve this question

marked as duplicate by random, BinaryMisfit Sep 4 '09 at 12:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

@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 Sep 4 '09 at 11:01
Then take that one: meta.stackexchange.com/questions/8144/… – Ladybug Killer Sep 4 '09 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 Sep 4 '09 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. – Joel Coehoorn Sep 4 '09 at 14:03
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 May 5 '12 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?

share|improve this answer
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 Sep 4 '09 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 Feb 7 '12 at 20:03
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 Nov 28 '12 at 21:45

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