Where is the location of the file that stores Mac keyboard shortcuts

keyboardshortcut

This file is used to edit or add special shortcuts that don't appear in the Mac menu bar or System Preferences. Some examples:

Ctrl-b → Move back one character
Ctrl-f → Move forward one character
Option-b → Move back one word
Option-f → Move forward one word

Editing this special shortcut text file made these commands work throughout all Mac applications. No issues still works! However, I am unable to locate this file's path again now that some time has passed. I want to fiddle with it some more.

Hints:

  • Plain text file.
  • The file in somewhere in ~/Library. No idea on the name.
  • Not looking for the System Preferences keyboard shortcuts.
  • Not the same file that stores the System Preferences keyboard shortcuts. (hard-part)
  • Editing this file will change the shortcut across all Mac applications, e.g. Safari, Notes, Finder, Pages, etc. This won't effect 3rd party apps. This behavior is desirable.

Best Answer

Cocoa text system keybinding defaults:

The standard key bindings are specified in /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict

To override Cocoa text keybindings:

...create a file named DefaultKeyBinding.dict in ~/Library/KeyBindings/ and specify bindings to augment or replace the standard bindings. You may use the standard bindings file as a template. It is recommended that you use the Property List Editor application to edit a bindings dictionary. You may use another application such as TextEdit or Xcode, but if you do you must ensure the encoding of the saved file is UTF8.

https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html