11

I use TextEdit to edit my text.

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

How to avoid this?

1
  • I noticed this in Notes as well! Jun 3, 2017 at 23:02

2 Answers 2

21

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
0
0

In TextEdit, the solution given by grg's answer only works on a per-document basis.

The disable this for all documents you need to go to the menu TextEditPreferences and disable it there, under Options:

TextEdit preferences dialog

You must log in to answer this question.

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