I use TextEdit to edit my text.

If I type in a double -, it is converted to one longer -.

How to avoid this?

  • I noticed this in Notes as well! – MicroMachine Jun 3 '17 at 23:02

Go to Edit → Substitutions and disable Smart Dashes.

You can disable this globally in System Preferences: Keyboard → Text. Disable ‘Use smart quotes and dashes’.

To only disable the dash substitution globally whilst leaving smart quotes enabled by adding the substitution to System Preferences: Keyboard → Text. Add a new entry set to -- for both ‘replace’ and ‘with’ to disable the substitution. This works because entries here override the OS regardless of whether substitutions are enabled.

To disable the dash substitution globally without this workaround, you can disable NSAutomaticDashSubstitutionEnabled:

defaults write -g NSAutomaticDashSubstitutionEnabled 0
  • 5
    I have to admit, I turn off auto-correct-type features in every program I can. I don't like a program trying to pretend it knows what I want more than I do... – Ghotir May 31 '17 at 13:49
  • 1
    @Ghotir I like the autocorrect features. Double-tapping the - key is much faster than ⇧⌥-. – grg May 31 '17 at 14:13
  • 1
    This can be set globally in system preferences – John Keates May 31 '17 at 14:19
  • 3
    @grgarside I was't trying to imply my way was the only (or best) way. Your mileage may definitely vary. :) – Ghotir May 31 '17 at 14:20
  • 2
    I'm puzzled how this very elementary question solved by simply looking a the Edit menu would rank such importance – Tom Gewecke May 31 '17 at 21:21

You must log in to answer this question.

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