Is it possible to migrate keyboard shortcuts for all my applications via an export?

I have a bunch of keyboard shortcuts setup for Pages, Keynote, and several other programs. Is there a way to export and then import these shortcuts? I just reformatted my home computer and am now going through the painful process of re-creating all the shortcuts.

Paul Irish's dotfiles got me thinking about this: https://github.com/paulirish/dotfiles


It depends on how you have defined the shortcut keys. The files responsible for storing these preferences are in the usual place: ~/Library/Preferences

You could simply move the files that store the preferences over to the new Mac:

  • com.apple.symbolichotkeys.plist
  • com.apple.universalaccess.plist
  • com.apple.iWork.Keynote.plist
  • com.apple.iWork.Pages.plist

If you were good at parsing JSON or XML, you could do the export to a text file as well using the plutil tool.


The shortcuts for sandboxed applications are stored in ~/Library/Containers/*/Data/Library/Preferences/*.plist. The shortcuts for all applications are in ~/Library/Preferences/.GlobalPreferences.plist. You could probably just copy the preference files from the old account.

I use a shell script like this to configure the shortcuts in the old-style property list format. You can print the current settings with defaults read.

defaults write -g NSUserKeyEquivalents '{
"Back" = "@\UF702";
"Go Back" = "@\UF702";
"Forward" = "@\UF703";
"Go Forward" = "@\UF703";
"Minimize" = "\0";
}'

defaults write com.apple.finder NSUserKeyEquivalents '{
"Show Package Contents" = "@\r";
}'