This documentation is generated automatically from the comments and commands in the DefaultKeyBinding.dict file. The script documentkeybindings.rb is free for use, but it’s specifically designed for use with my formatting in the bindings plist (i.e. It’s a little finicky).
Most users of Mac OS X, even long-time Apple geeks, know only a fraction of the available text system shortcuts. This is a tragedy, as they are consistent across all applications which use the Cocoa text system, including TextEdit, Mail, iChat, Safari, and countless third-party applications. This documentation is generated automatically from the comments and commands in the DefaultKeyBinding.dict file. The script documentkeybindings.rb is free for use, but it's specifically designed for use with my formatting in the bindings plist (i.e. It's a little finicky). This project is maintained by ttscoff. Create a folder named ‘KeyBindings’ in the ‘Library’ folder if it doesn’t exist already. Also create a text-file named ‘DefaultKeyBinding.dict’. After that it should look like this: File ‘DefaultKeyBinding.dict’ contains new keybindings for Alt + R and Alt + Q. I created a dummy function for these shortcuts. DefaultKeyBinding.dict file (/Library/KeyBindings/DefaultKeyBinding.dict) for Mac OS X, created by Brett Terpstra and based heavily on work done by Lri. Please note that these bindings won't work in all applications: TextWrangler and TextMate, for example, override these with their own settings.
In today’s SAP Development Community, more and more MacBook’s are being used. With the latest development tools in the cloud (SAP Web IDE & SAP Web IDE Full-Stack) or made for multiple operating systems (Eclipse), we as developers are no longer required to use Windows.
SAP Web IDE Shortcuts
When developing Fiori and UI5 apps using SAP Web IDE, I want to use as many shortcuts as possible to speed up the development. I noticed this won’t always work as desired on a Mac. The shortcuts can cause side effects which will make them unusable. Some shortcuts can be customized, but not all.
For example, you can use these shortcuts to switch between tabs:
- Move to the tab on the right: Alt + R
- Move to the tab on the left: Alt + Q
Unfortunately, these shortcuts can’t be customized.
What’s the cause of this problem?
In macOS these shortcuts also have a function. So when choosing Alt + Q in Web IDE the screen is moving one tab to the left, but on the source tab there is also a ‘Œ’ symbol added to the file:
This is very annoying.
The solution
Symbols like ‘Œ’ are rarely used by me, so I decided to turned this particular function off. This is possible in a very easy way!
In macOS you can add custom keybindings by saving a property list like the one below as ~/Library/KeyBindings/DefaultKeyBinding.dict.
Create a folder named ‘KeyBindings’ in the ‘Library’ folder if it doesn’t exist already. Also create a text-file named ‘DefaultKeyBinding.dict’. After that it should look like this:
File ‘DefaultKeyBinding.dict’ contains new keybindings for Alt + R and Alt + Q. I created a dummy function for these shortcuts:
Restart the application, aka the browser and start SAP Web IDE. Enjoy your shortcuts!
MacOS has a system-wide mechanism to let you define or modify the shortcut keys for text editing operations.
It lets you create keys to:
- Insert math symbols, emoji, or any template text.
- Move cursor by word, page up/down.
- Copy, cut, paste, undo, redo.
- select word, line, paragraph, select all.
- upcase word, lowercase word.
- new, open, save, etc.
- and more.
Key Config File
Create a file at
~/Library/KeyBindings/DefaultKeyBinding.dict
Create the “KeyBindings” folder if you don't already have it.
Copy and past the following:
Note: if you use Unicode Characters directly in the file such as♥, you must save the file using UTF-8 encoding.
Launch or restart TextEdit or other app to start to use your changes.
The syntax in general is this:
- keycode is a string that represents key press.
- actionCode represents what to do.
Keycode Syntax
Action Code
Unicode Reference
If you want to create lots keys to insert math symbols or emoji, see
Sample File
Example of defining the {Home, End} keys to move to the beginning/end of line.
Here's example file for inserting Unicode characters with the ⌥option key.
Here's a example ofErgoEmacs Keybinding, one for QWERTY layout and one forDvorak Keyboard Layout:
You can look at Xcode's keybinding file at/Developer/Applications/Xcode.app/Contents/Resources/PBKeyBinding.dict
.You can view it here: osx_keybinding_xcode.dict.txt.
Emacs Keybinding
Mac OS X by default support emacs keybindings. They are:
- Ctrl+f → move forward
- Ctrl+b → move backward
- Ctrl+n → move down a line
- Ctrl+p → move up a line
- Ctrl+a → beginning of line
- Ctrl+e → end of line
- Ctrl+k → delete current position to end of line
- Ctrl+y → paste
You can add more of emacs's
- Ctrl+space → set mark
- Ctrl+w → cut
- Ctrl+xCtrl+x → Swap cursor position to last mark
However, i don't recommend it. Emacs's keys is very inefficient and ergonomically painful.See: Why Emacs's Keyboard Shortcuts are Painful.If you like a efficient keybinding for text editing, try:Emacs: Xah Fly Keys.
Problems
Something this cannot do. For example:
- It cannot remap keys.
- It can't set a key such as F8 to type other keys such as ⌘command+c.
- It can't set a key to launch a app or script.
There are many solutions to these. See:Mac: Key Remapping, Keybinding Tools
Best is to get a programable keyboard. See:Programable Keyboards with Onboard Memory
See also:Problems of Mac OS X DefaultKeyBinding.dict.
Reference
Mac Defaultkeybinding.dict
- Text System Defaults and Key Bindings By Apple. At https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html
- Technical Note TN2056: Installable Keyboard Layouts At https://developer.apple.com/library/mac/technotes/tn2056/_index.html
back toKeyboard Shortcut and Layout Tutorial
- amazon egift card to xah@xahlee.org , $20 is nice.
- paypal to xah@xahlee.org , $20 is nice.
- bitcoin me 19dfoa3Q7oehm9MwCULQzBG8vqfCaeMazH
My Defaultkeybinding.dict For Mac Os
If you have a question, put $5 at patreon and message me.