This behaviour is controlled by a system default. To turn it off, type at the terminal:
defaults write -app 'Keynote' TSWPAutomaticDashSubstitution 0
or
defaults write 'Apple Global Domain' TSWPAutomaticDashSubstitution 0
The first turns off dash substitution for a particular app (here, Keynote); the second for all apps that don't have their own, overriding, default set explicitly. Replace 0
by 1
to turn dash substitution back on.
As other replies here have stated, the global default can also be changed using System Preferences (Keyboard>Text>Checkbox "Use smart quotes and dashes"), but this turns on and off quote substitution as well as dash substitution. Moreover, some apps, but not all, allow you to change their defaults by control-clicking in a text field and selecting Substitutions or Show Substitutions. For example, Mail lets you do this, but Keynote does not.
If you want to turn on quote substitution, say, for Keynote use
defaults write -app 'Keynote' NSAutomaticQuoteSubstitutionEnabled 1
or, to turn it on for everything that does not have an overriding default, use
defaults write 'Apple Global Domain' NSAutomaticQuoteSubstitutionEnabled 1
To turn it off, use 0
instead of 1
.
2Just a note for other people reading, that if it's not a OSX thing for you, then it may be your text editor. I had to change TextEdit with Preferences > Smart dashes. – levininja – 2016-06-16T15:58:32.987
wonder what the solution of macOS Sierra is. – Charlie Parker – 2016-12-13T01:06:36.253
It seems that some apps have to be closed and open for things to work. I was using notes app and it seems it didn't to work until I closed an open the app (completely quit it). It might have been I did
defaults write 'Apple Global Domain' NSAutomaticDashSubstitutionEnabled 0
, but who knows. – Charlie Parker – 2017-03-20T20:49:06.587