How do you disable an application specific hotkey, for example, "Command-P"?
This can be achieved by remapping the Print shortcut to a different shortcut that is out of the way, unused and unlikely to be pressed.
Open System Preferences → Keyboard → Shortcuts → App Shortcuts.
Click + to add a new shortcut.
-
Application: All Applications
Menu Title: Print… (that's a 'proper' ellipses by the way, use copy-paste if necessary)
Keyboard Shortcut: Set it to something out of the way.
Click Add.
Now, the Print command is set to a random keyboard shortcut, freeing up ⌘P.
You can also use defaults to change the shortcut to something like U+200B (ZERO WIDTH SPACE):
defaults write -g NSUserKeyEquivalents -dict-add Print... '\U200b'
nil
would be triggered when pressing n in some applications like Audacity and \0
would be triggered when pressing any key in Safari in 10.9.
I use a shell script like this to configure the shortcuts:
defaults write -g NSUserKeyEquivalents '{
"Show Previous Tab"="~@\Uf702";
"Show Next Tab"="~@\Uf703";
"Minimize"="\U200b";
}'
defaults write com.apple.Finder NSUserKeyEquivalents '{
"Show Package Contents"="@\r";
}'