# Enabling the tab key in markdown editor

**URL:** https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666
**Category:** Feature
**Tags:** composer
**Created:** [October 1, 2014, 4:54pm UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666 "2014-10-01T16:54:34Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![hstove](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hstove/32/114343_2.png) [@hstove](https://meta.discourse.org/u/hstove)
#### Post date: [October 1, 2014, 4:54pm UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/1 "2014-10-01T16:54:35Z")

</div>

Hey wonderful discourse maintainers,

I was wondering if there was a policy about enabling the tab key when editing markdown. I was recently composing a list and I wanted to indent, so I hit `enter`, `tab`, `-`, and then `space`, which triggered the “reply to topic” action unintentionally.

It would be fantastic if users could set a preference to enable the tab key inside text editors.

I’m sorry if this has been discussed before. What do people think?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [October 2, 2014, 12:04am UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/2 "2014-10-02T00:04:22Z")

</div>

Hmm, I’m pretty sure that this would hurt accessibility, but it might be a good idea… We already have Ctrl-Enter to submit.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 2, 2014, 12:29am UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/3 "2014-10-02T00:29:43Z")

</div>

Tab is expected to move from field to field, so this would seriously hurt keyboard accessibility and standard browser conventions.

---

<div class="post-metadata">

### Author: ![hstove](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hstove/32/114343_2.png) [@hstove](https://meta.discourse.org/u/hstove)
#### Post date: [October 2, 2014, 1:22am UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/4 "2014-10-02T01:22:12Z")

</div>

Yeah, I totally understand that this would be non-standard behavior and less accessible. The right solution, I think, would be to enable it only by user opt-in.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [October 2, 2014, 2:10pm UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/5 "2014-10-02T14:10:23Z")

</div>

I can’t even do it in GMail. ☹

I was thinking something like CTRL+TAB which you would use in Excel, but I’m not finding any online composers that permit this behavior…

---

<div class="post-metadata">

### Author: ![vulkanino](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vulkanino/32/119654_2.png) [@vulkanino](https://meta.discourse.org/u/vulkanino)
#### Post date: [October 3, 2014, 7:47pm UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/6 "2014-10-03T19:47:45Z")

</div>

In Chrome CTRL TAB takes you to the next… tab.

I think it’s been a poor choice of using the Tab key to move to the next field. But now we have to keep it, it’s too late.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [October 3, 2014, 9:26pm UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/7 "2014-10-03T21:26:21Z")

</div>

That is browser design 101… You will find that was happening well back in IE 6. So that isn’t a Discourse only issue.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 3, 2014, 9:30pm UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/8 "2014-10-03T21:30:45Z")

</div>

Tab was used to iterate from field to field for as long as I can remember in computer GUIs.

> **[Tab key](https://en.wikipedia.org/wiki/Tab_key#Modern_usage)**
>
> A tab key .mw-parser-output .keyboard-key{border:1px solid #aaa;border-radius:0.2em;box-shadow:0.1em 0.1em 0.2em rgba(0,0,0,0.1);background-color:var(--background-color-neutral-subtle,#f8f9fa);background-image:linear-gradient(to bottom,var(--background-color-neutral,#eaecf0),var(--background-color-neutral-subtle,#f8f9fa),var(--background-color-neutral,#eaecf0));color:var(--color-base,#202122);padding:0.1em 0.3em;font-family:inherit;font-size:0.85em}Tab ↹ is a key on a typical computer or typewrit...

Per Wikipedia, tab as a key to move from field to field in a GUI dates back to at _least_ 1987.

> **[IBM Common User Access](https://en.wikipedia.org/wiki/IBM_Common_User_Access)**
>
> Common User Access (CUA) is a standard for user interfaces to operating systems and computer programs. It was developed by IBM and first published in 1987 as part of their Systems Application Architecture. Used originally in the MVS/ESA, VM/CMS, OS/400, OS/2 and Microsoft Windows operating systems, parts of the CUA standard are now implemented in programs for other operating systems, including variants of Unix. It is also used by Java AWT and Swing.
> IBM wanted a standard way to interact with tex...

---

<div class="post-metadata">

### Author: ![vulkanino](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vulkanino/32/119654_2.png) [@vulkanino](https://meta.discourse.org/u/vulkanino)
#### Post date: [October 6, 2014, 12:56pm UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/9 "2014-10-06T12:56:18Z")

</div>

As we all know, when working in a desktop editor, the tab **always** adds spaces. The problem is the choice of using the same key (tab) to do two completely different things.

Try it in Notepad 🙂

---

<div class="post-metadata">

### Author: ![robreed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robreed/32/36296_2.png) [@robreed](https://meta.discourse.org/u/robreed)
#### Post date: [October 14, 2015, 3:13pm UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/10 "2015-10-14T15:13:51Z")

</div>

This has always bugged me. And I realize it’s not specific to Discourse. But it’s my understanding that Discourse is about ‘reimagining what a modern Internet discussion platform should be today’.

I’m wondering how other people handle it. I fully understand and appreciate the browser convention. This doesn’t change the fact that tab is valid content. Also, it’s preserved when copying and pasting content into the editor. I see it as 2 separate but overlapping issues.

The browser convention issue is resolved with…

> [@Enabling the tab key in markdown editor](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/8):
>
> Tab was used to iterate from field to field for as long as I can remember in computer GUIs. Per Wikipedia, tab as a key to move from field to field in a GUI dates back to at least 1987.

But that leaves the content issue.

I’m not bringing this up just to be pedantic. I’m playing around with Discourse as a place to post code and markup snippets and this is something that does come up.

Cheers

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 14, 2015, 6:41pm UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/11 "2015-10-14T18:41:34Z")

</div>

Never gonna happen on my watch. Tab means move to next field in the browser, always has, always will.

---

<div class="post-metadata">

### Author: ![Dani1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dani1/32/84172_2.png) [@Dani1](https://meta.discourse.org/u/Dani1)
#### Post date: [May 7, 2018, 12:23pm UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/12 "2018-05-07T12:23:02Z")

</div>

> [@codinghorror](#):
>
> Tab was used to iterate from field to field for as long as I can remember in computer GUIs.

this is a very old topic, so maybe there’s fresh stuff going on, but I’m with Jeff on ‘tab’ meaning field to field. so I came here to ask how I can change this:

> tab followed by enter leads to posting the topic/reply.

which is seriously inconvenient in my case. Any suggestions on how I can stop that? thanks!

---

<div class="post-metadata">

### Author: ![joellabes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joellabes/32/272968_2.png) [@joellabes](https://meta.discourse.org/u/joellabes)
#### Post date: [September 9, 2022, 4:30am UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/14 "2022-09-09T04:30:35Z")

</div>

I just discovered that highlighting a line of text and pressing tab will indent it, which is a pretty good middle ground!

It also works if you select multiple lines, obviously.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 13, 2022, 7:01am UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/15 "2022-09-13T07:01:57Z")

</div>

It does indeed! Was a wonderful little feature @martin added a while back.

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [September 28, 2024, 7:03am UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/16 "2024-09-28T07:03:14Z")

</div>

It would be nice if we could use _tab_ for indentation.

- First line \> _enter_
- next “-” appears after _enter_
  - using _tab_ to go a level deeper

Hope this isn’t too complicated to implement.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 28, 2024, 11:37am UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/17 "2024-09-28T11:37:22Z")

</div>

This is surely constrained by Markdown?

Markdown uses a double space for indicating a bullet indent.

Spaces are used for managing:

- First level
  - Second level

> **[Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)**
>
> Google Chrome, Firefox, and Thunderbird extension that lets you write email in Markdown and render it before sending. - adam-p/markdown-here

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [September 28, 2024, 10:14pm UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/18 "2024-09-28T22:14:58Z")

</div>

In most Markdown editors I can simply go to the next (or previous) level by using tab & shift-tab.

Currently tab takes you out of the composer.. surely that can be handled better right?

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [September 29, 2024, 2:30am UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/19 "2024-09-29T02:30:06Z")

</div>

That would be super valuable here in Discourse.

I’ve often wondered why it doesn’t.

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [September 29, 2024, 4:21am UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/20 "2024-09-29T04:21:06Z")

</div>

> [@codinghorror](#):
>
> Per Wikipedia, tab as a key to move from field to field in a GUI dates back to at _least_ 1987

In word processing like Word Perfect, Pagemaker, MSword etc.. it indents as per the function of a typewriter. Sure once you move outside of the “composer” tab works as you mentioned. But while composing a document inside the composer window in word processors it functions as an indent.

In the spirit of the wiki 😉

[Tab key - Simple English Wikipedia, the free encyclopedia](https://simple.m.wikipedia.org/wiki/Tab_key#:~:text=The%20tab%20key%20)(short%20for,to%20the%20next%20tab%20stop.&text=In%20word%20processor%20applications%2C%20the,to%20the%20next%20tab%20stop.

 ![This is a screenshot of a Wikipedia page, featuring a black keyboard with the letter 'T' highlighted, and text explaining the structure of the Tab key. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/7/0/0/700d0832760cbe8eff447545c30b854b3861b495.jpeg)

While inside the composer; you are within a word processing environment window.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [September 29, 2024, 6:30am UTC](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666/21 "2024-09-29T06:30:11Z")

</div>

Yes fair point. No reason why tab key couldn’t type the spaces?

[Next page](https://meta.discourse.org/t/enabling-the-tab-key-in-markdown-editor/20666.md?page=2)
