macOS 10.14.4 introduced a keyboard shortcut that conflicts with one of IntelliJ IDEA’s best shortcuts. cmd-shift-a
pops open a Terminal window running an apropos search on the text selection, rather than the command palette.
You can manually disable these keyboard shortcuts via System Preferences, but this script does this programmatically. I was unable to find any existing information about how to do this via the command line, so I rolled my own solution.
It took a long time to work out which defaults
domain to find the plist for this. I probably worked out the pbs
domain from this post.
TEMP_SETTINGS_FILE=$(mktemp -t 'man-shortcuts-off.json')
cat > $TEMP_SETTINGS_FILE <<EOF
{
"NSServicesStatus": {
"com.apple.Terminal - Open man Page in Terminal - openManPage": {
"presentation_modes": {
"ContextMenu": false,
"ServicesMenu": false
},
"enabled_context_menu": false,
"enabled_services_menu": false
},
"com.apple.Terminal - Search man Page Index in Terminal - searchManPages": {
"presentation_modes": {
"ContextMenu": false,
"ServicesMenu": false
},
"enabled_context_menu": false,
"enabled_services_menu": false
}
}
}
EOF
# Settings are stored in the pbs domain. Other settings in this domain will not be overwritten. I’ve included the settings to change in JSON for brevity. They are converted to XML (which `defaults import` expects) before being imported.
plutil -convert xml1 -o - ${TEMP_SETTINGS_FILE} | defaults import pbs -
rm ${TEMP_SETTINGS_FILE}
Nice! Just seen this after coming across your comment on the JetBrains blog.