4

This question applies to Markdown (yes, I'm still peeved .md format doesn't interpret -- and --- as en and em dashes), but it could be handy for other text formats.

Is anyone aware of an extension or can suggest a method for replacing the typed sequences of -- and --- with and , respectively?

There are other markdown editors that do it, but since I'm using vscode for nearly everything else now, I'd rather do it there.

2
  • 1
    Just a minor note that --- three or more dashes have special meaning in markdown and used for file header, horizontal line <hr> and in some versions to draw tables, so it makes sense that they are not transformed automatically.
    – Alex
    May 5, 2019 at 20:13
  • Some markdown flavours like Kramdown interpret the --- differently if they on a line by themselves, which I think is great
    – LeeM
    Jul 10, 2020 at 4:24

2 Answers 2

4

You can use Snippets

"– en": {
    "prefix": "--",
    "body": "–"
},
"— em": {
    "prefix": "---",
    "body": "—"
},
0
0

On Windows and Mac, you can also use these keyboard shortcuts:

Em dash (—): Windows: Alt + Ctrl + –; Mac: Shift + Option + -

En dash (–): Windows: Ctrl + –; Mac: Option + -

- = hyphen/minus

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.