How to configure keyboard shortcuts for special characters on OS X?

17,388

Solution 1

Create ~/Library/KeyBindings/ and save a property list like this as DefaultKeyBinding.dict:

{
    "~c" = (insertText:, "©");
}

Applying changes requires reopening applications. The custom keybindings don't work in all applications or views, but they do seem to work in Sublime Text 2.

For more information, see hcs.harvard.edu/~jrus/Site/Cocoa%20Text%20System.html and osxnotes.net/keybindings.html.

You could also make a custom keyboard layout with Ukelele or create a private.xml in KeyRemap4MacBook.

Solution 2

To type © on a Mac, it's Alt+g

To configure keyboard shortcuts for special characters on OS X:

System Preferences > Language & Text > Text > Symbol & Text substitution. Use the + on the bottom of the list to add the ones you want.

EDIT 08/19/12:

According to http://www.macworld.com/article/1160500/text_substitutions.html, you can make Text Substitution universal in Macs by executing the command in Terminal:

defaults write -g WebAutomaticTextReplacementEnabled -bool true

Solution 3

Another method is to trick your computer into auto-correcting some string of text to the symbol of your choice.

For example, typing theta changes to θ

To do this on Mavericks go to: System Preferences > Keyboard > Text

Share:
17,388

Related videos on Youtube

MaiaVictor
Author by

MaiaVictor

Updated on September 18, 2022

Comments

  • MaiaVictor
    MaiaVictor almost 2 years

    How to configure keyboard shortcuts for special character on OS X? For example, one would set ALT+C to ©.

  • superuser
    superuser almost 12 years
    I have made an edit to the answer, hope this helps.
  • MaiaVictor
    MaiaVictor almost 12 years
    Symbol & Text substitution is not working for my editor, sublime.
  • superuser
    superuser almost 12 years
    I'm not familiar with Sublime, but I found this article which might help in your case: macworld.com/article/1160500/text_substitutions.html
  • Admin
    Admin almost 12 years
    @superuser, that link contains some nice info. Please add the defaults write and Edit > Substitutions to your answer.
  • brevno
    brevno almost 12 years
    The defaults command does the same thing as the checkbox in the Language & Text preference pane.
  • boulder_ruby
    boulder_ruby over 10 years
    This answer is no longer timely for Mavericks. Your menu options listed here do not exist now
  • paulmelnikow
    paulmelnikow about 9 years
    In Mavericks, it's Keyboard > Text.
  • P A N
    P A N over 8 years
    @´ This gives me a syntax error when trying to source the file: DefaultKeyBinding.dict: line 2: syntax error near unexpected token `('