How to disable smart quotes
In addition to System Preferences, this feature can be turned on and off in each app via Edit > Substitutions. Make sure you check that setting as well.
In El Capitan (i.e. 10.11.1), I solved it by changing the Smart Quote settings:
- Open Keyboard in System Preferences
- Go to Text tab
- Change values for "for Double Quotes" and "for Single Quotes" from drop-down selection to use the simple quotes "" rather than ““
That's it. No need to disable or do any other workaround. Hope this helps, as I had this problem with Message app when posting code.
This shell script disables smart quotes in all applications that currently have preferences files:
for d in $(defaults domains|tr -d ,);do
osascript -e "app id \"$d\""&>/dev/null||continue
defaults write $d SmartQuotes -bool false
# defaults write $d SmartDashes -bool false
# defaults write $d SmartLinks -bool false
# defaults write $d SmartCopyPaste -bool false
# defaults write $d TextReplacement -bool false
# defaults write $d CheckSpellingWhileTyping -bool false
done
Uncomment the commented out lines to also disable other substitutions or spell checking.
Unfortunately none of the posted solutions worked for me. I've solved by changing my keyboard layout from:
U.S. International - PC
to:
U.S.
Disable smart quotes:
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
Disable smart dashes:
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
Disable smart quotes for TextEdit:
defaults write com.apple.TextEdit SmartQuotes -bool false
Disable smart dashes for TextEdit:
defaults write com.apple.TextEdit SmartDashes -bool false