120

I think it's a Mountain Lion thing, when you type - (dash) twice, it becomes — (emdash). When you type tm, it becomes ™ (trademark symbol). Or when you type three . (dot), it becomes … (elipsis). Some are useful, some are very annoying. Overall, I want to stop that. How can I achieve this?

3
  • 3
    Just 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
    Jun 16, 2016 at 15:58
  • wonder what the solution of macOS Sierra is. Dec 13, 2016 at 1:06
  • 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. Mar 20, 2017 at 20:49

12 Answers 12

115

(on Sierra 10.12, this is now in the Keyboard control panel)

Go to the system preferences and choose "Language & Text"

enter image description here

In the "Text" tab you will find the list of substitutions.

enter image description here

If you want to stop -- from being turned into (emdash) you need to use the + button and add a new rule to replace -- with -- (replace with itself)

Or, right click in a text field and go to "Substitutions" and disable "Smart Dashes"

Stupid Dashes

17
  • 4
    ah okay, so if I make another rule as "--" to "--" then it saves my double dashes. Thanks!
    – beatak
    Feb 22, 2013 at 7:38
  • 4
    Adding -- to be replaced by itself does not seem to work in Yosemite (and Keynote) :( Mar 27, 2015 at 13:47
  • 2
    @BalintErdi I just found this question again by googling for the issue, found the answer, thought Hmmm, this doesn't work, what idiot posted that trick and then saw it was own damn edit. LOL. I just updated the answer, hopefully that works better now!
    – Josh
    Apr 24, 2015 at 5:23
  • 5
    El Capitan 11.11 This is now on the Keyboard control panel.
    – vy32
    Nov 18, 2015 at 11:58
  • 3
    I had to close and reopen TextEdit for it to work on Yosemite. No reboot required.
    – Kris
    Apr 15, 2016 at 8:52
50

I encountered this same problem on Mavericks (10.9), where the fix has changed slightly. Go to System Preferences, then "Language & Region" then click the "Keyboard Preferences..." button and to go to "Text" tab. It is no longer a substitution, however, but instead on the right-hand side of the window there is a tickbox "Use smart quotes and dashes". Unticking this stops it changing two hyphens into an en-dash.

One little gotcha: on 10.9.5 with TextEdit (and probably others) you must exit then restart your editor to have this change take effect.

6
  • 1
    And also disables smart quotes. I have no idea why Apple decided to lump those two into the same bucket in the preferences. Fortunately, you can disable them individually under Edit > Substitutions, though that behavior is per-app.
    – dgatwood
    Feb 2, 2016 at 1:40
  • 8
    In 10.11 El Capitan at least, it's possible to disable just smart dashes (while keeping smart quotes) by running defaults write 'Apple Global Domain' NSAutomaticDashSubstitutionEnabled 0 from the terminal. There are two separate settings under the hood, NSAutomaticDashSubstitutionEnabled and NSAutomaticQuoteSubstitutionEnabled, both of which get toggled by the UI checkbox "Use smart quotes and dashes". But there's no guarantee from Apple that this won't change in future versions of OS X. Feb 17, 2016 at 22:23
  • 1
    thanks a lot @AdamRosenfield, your solution is by far the best listed here.
    – zanona
    Apr 5, 2016 at 12:14
  • 1
    @AdamRosenfield, you should elevate this comment to an answer so we can vote for it. :-)
    – Nick K9
    Jul 19, 2016 at 16:14
  • you sure this works? Do I need to reboot my Mac or restart my apps? Mar 10, 2017 at 19:40
28

In 11.11 this is under System Preferences > Keyboard. There is a checkbox for Use smart quotes and dashes.

Keyboard pref in 11.11

5
  • 5
    Except that doing that also disables smart quotes, which you probably don't want to do. Turning off smart dashes under Edit > Substitutions fixes the problem more cleanly (turning off just the dashes), with the caveat that the behavior is per-app. (Why!?!)
    – dgatwood
    Feb 2, 2016 at 1:39
  • 1
    Why would you want smart quotes? I've always considered those a solution to a problem that never actually existed. They are also especially horrid for programmers. Nov 1, 2016 at 19:01
  • you sure this works? Do I need to reboot my Mac or restart my apps? Mar 10, 2017 at 19:40
  • @dgatwood So not all applications support Edit > Substitions. In Slack for instance I see no solution other than to disable both as this answer suggests doing. +1 for this answer (although I don't mind smart quotes if type them in) Mar 22, 2017 at 14:05
  • For consistent results, I had to close the app (Notes in my case) and System Preferences (Keyboard prefs window).
    – Wes
    May 7, 2020 at 21:23
22

In earlier versions of Mac OS X, there were two separate options for smart quotes and smart dashes in the Keyboard System Preferences; however in at least versions 10.9 through 10.11, that option has been replaced by a single "Use smart quotes and dashes" preference.

Fortunately, there are still two separate preferences under the hood, and the UI checkbox toggles both of them simultaneously. You can enable or disable just one of smart quotes or smart dashes from the terminal:

# Disable just smart dashes
defaults write -g NSAutomaticDashSubstitutionEnabled 0

# Disable just smart quotes
defaults write -g NSAutomaticQuoteSubstitutionEnabled 0

# To re-enable, set either back to 1.

This is currently true as of OS X 10.11; this may change in future versions of OS X (or macOS, as it will now be called).

4
  • Still works as of 10.12.6 - thank you!
    – Glenn
    Feb 6, 2018 at 14:14
  • Still works on 10.13 as well. Mar 20, 2018 at 10:38
  • Still works on 10.15.2!
    – Ben S
    Jan 18, 2020 at 8:41
  • Doesn't seem to work under Big Sur 11.6.3 ... Apr 20, 2022 at 9:22
5

Not sure if you folks are still having this problem but I just discovered how frustrating it can be. I was writing a unix script for Apple Remote Desktop which requires a --get flag and it kept getting converted to an em dash, ruining the command.

I couldn't find a way to turn off the em dash conversion, but all hope is not lost. In the Language & Text menu (Text tab) I created an entry that replaces -- with -- (i.e. it replaces two dashes with itself). This overrides the system converting -- to an em dash.

1
  • Unfortunately this does not seem to work under Big Sur 11.6.3 and Powerpoint for Mac, Version 16.60. I couldn't find the double-dash settings in Powerpoint's "Autocorrect" option panel, so I hoped that a "global" Mac system pref setting will cure this nonsense. It didn't :-( Apr 20, 2022 at 9:20
4

It's worth mentioning that even with "use smart quotes and dashes" enabled, you can still "undo" the auto-conversion of -- to — (emdash) by pressing CMD+Z. If turning smart dashes off completely sounds too extreme, this is one way to bring back the -- (double dash).

Also, here's my horror story about “curly quotes:” I had been using Github for years and wondered why my "contributions" never appeared correctly on my profile. I eventually discovered I had configured my git user name in terminal with curly quotes instead of straight marks:

git config --global user.name “Steve”       //instead of...
git config --global user.name "Steve"

Even though I was copy/pasting the command directly from GitHub's instructions, TextEdit was “fixing” my quotes before I put them in Terminal. Unbelievable! This drove me insane, but I'm recovering...

4

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.

2
  • For Slack, where this was driving me crazy, I think the setting key is WebAutomaticDashSubstitutionEnabled.
    – Michael
    Mar 29, 2017 at 15:01
  • Exactly what I was looking for, thanks for sharing!
    – Rogare
    Feb 25, 2019 at 11:52
2

In you're using Apple "Office" tools: Page, Number, etc, the settings in System Preferences or the command line defaults command as mentioned in previous answers won't affect the smart substitutions. Instead, you'll have to go to top tool bar Edit > Substitutions menu to check or uncheck 'Smart Quotes', 'Smart Dashes' etc.

If you're using TextEdit then 7stud's answer is the way, which is included here for completeness: TextEdit > Preferences and check/uncheck the settings in the bottom sections.

1

If you just want to prevent this from happening on occasion, or per some specific instance, you can simply wait for Mac to make the unwanted change and then press CMD+z to undo.

1
  • Have you tested this with the "--' and "—" to confirm this works as expected as described by the OP? Oct 9, 2017 at 17:51
0

Yosemite 10.2 and TextEdit:

  1. Launch TextEdit.

  2. TextEdit>Preferences

  3. In bottom right corner, uncheck Smart dashes .

  4. If your TextEdit file is open, close it and reopen it.

0

Ctrl + Command + Space will prompt the list of emoji.

Search on "dash" by starting typing. And you will get this filtered list:

  • Use the 7th emoji twice.

enter image description here

0

In Mac Ventrua 13.5.2, you can find above menu in [System Preferences]->[Keyboard] ->[Text Input] -> [Input Sources] -> [Edit...]-> [Use smart quotes and dashes]

  1. [System Preferences]->[Keyboard] ->[Text Input] -> [Input Sources] enter image description here

  2. [Edit...] -> [Use smart quotes and dashes]

enter image description here

You must log in to answer this question.

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