To do this, create a new file called
~/Library/KeyBindings/DefaultKeyBinding.dict and put the following text into it (You'll probably have to create the directory the first time -- this is okay).
Re-login from your mac for changes to take effect.
This file remaps the key bindings of a single user on Mac OS X 10.5 to more closely
match default behaviour on Windows systems.
Here is a rough cheatsheet for syntax.
Key Modifiers
^ : Ctrl
$ : Shift
~ : Option (Alt)
@ : Command (Apple)
# : Numeric Keypad
Non-Printable Key Codes
Up Arrow: \UF700 Backspace: \U0008 F1: \UF704
Down Arrow: \UF701 Tab: \U0009 F2: \UF705
Left Arrow: \UF702 Escape: \U001B F3: \UF706
Right Arrow: \UF703 Enter: \U000A ...
Insert: \UF727 Page Up: \UF72C
Delete: \UF728 Page Down: \UF72D
Home: \UF729 Print Screen: \UF72E
End: \UF72B Scroll Lock: \UF72F
Break: \UF732 Pause: \UF730
SysReq: \UF731 Menu: \UF735
Help: \UF746
NOTE: typically the Windows 'Insert' key is mapped to what Macs call 'Help'.
Regular Mac keyboards don't even have the Insert key, but provide 'Fn' instead,
which is completely different.
*/
{
"@\UF702" = "moveToBeginningOfLine:"; /* Cmd + Left */
"$@\UF702" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Cmd + Left */
"@\UF703" = "moveToEndOfLine:"; /* Cmd + Right */
"$@\UF703" = "moveToEndOfLineAndModifySelection:"; /* Shift + Cmd + Right */
"\UF729" = "moveToBeginningOfLine:"; /* Home */
"^\UF729" = "moveToBeginningOfDocument:"; /* Ctrl + Home */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Shift + Ctrl + Home */
"\UF72B" = "moveToEndOfLine:"; /* End */
"^\UF72B" = "moveToEndOfDocument:"; /* Ctrl + End */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
"$^\UF72B" = "moveToEndOfDocumentAndModifySelection:"; /* Shift + Ctrl + End */
"\UF72C" = "pageUp:"; /* PageUp */
"\UF72D" = "pageDown:"; /* PageDown */
"$\UF728" = "cut:"; /* Shift + Del */
"$\UF727" = "paste:"; /* Shift + Ins */
"@\UF727" = "copy:"; /* Cmd + Ins */
"$\UF746" = "paste:"; /* Shift + Help */
"@\UF746" = "copy:"; /* Cmd + Help (Ins) */
"^\UF702" = "moveWordBackward:"; /* Ctrl + LeftArrow */
"^\UF703" = "moveWordForward:"; /* Ctrl + RightArrow */
"$^\UF702" = "moveWordBackwardAndModifySelection:"; /* Shift + Ctrl + Leftarrow */
"$^\UF703" = "moveWordForwardAndModifySelection:"; /* Shift + Ctrl + Rightarrow */
}
This file remaps the key bindings of a single user on Mac OS X 10.5 to more closely
match default behaviour on Windows systems.
Here is a rough cheatsheet for syntax.
Key Modifiers
^ : Ctrl
$ : Shift
~ : Option (Alt)
@ : Command (Apple)
# : Numeric Keypad
Non-Printable Key Codes
Up Arrow: \UF700 Backspace: \U0008 F1: \UF704
Down Arrow: \UF701 Tab: \U0009 F2: \UF705
Left Arrow: \UF702 Escape: \U001B F3: \UF706
Right Arrow: \UF703 Enter: \U000A ...
Insert: \UF727 Page Up: \UF72C
Delete: \UF728 Page Down: \UF72D
Home: \UF729 Print Screen: \UF72E
End: \UF72B Scroll Lock: \UF72F
Break: \UF732 Pause: \UF730
SysReq: \UF731 Menu: \UF735
Help: \UF746
NOTE: typically the Windows 'Insert' key is mapped to what Macs call 'Help'.
Regular Mac keyboards don't even have the Insert key, but provide 'Fn' instead,
which is completely different.
*/
{
"@\UF702" = "moveToBeginningOfLine:"; /* Cmd + Left */
"$@\UF702" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Cmd + Left */
"@\UF703" = "moveToEndOfLine:"; /* Cmd + Right */
"$@\UF703" = "moveToEndOfLineAndModifySelection:"; /* Shift + Cmd + Right */
"\UF729" = "moveToBeginningOfLine:"; /* Home */
"^\UF729" = "moveToBeginningOfDocument:"; /* Ctrl + Home */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Shift + Ctrl + Home */
"\UF72B" = "moveToEndOfLine:"; /* End */
"^\UF72B" = "moveToEndOfDocument:"; /* Ctrl + End */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
"$^\UF72B" = "moveToEndOfDocumentAndModifySelection:"; /* Shift + Ctrl + End */
"\UF72C" = "pageUp:"; /* PageUp */
"\UF72D" = "pageDown:"; /* PageDown */
"$\UF728" = "cut:"; /* Shift + Del */
"$\UF727" = "paste:"; /* Shift + Ins */
"@\UF727" = "copy:"; /* Cmd + Ins */
"$\UF746" = "paste:"; /* Shift + Help */
"@\UF746" = "copy:"; /* Cmd + Help (Ins) */
"^\UF702" = "moveWordBackward:"; /* Ctrl + LeftArrow */
"^\UF703" = "moveWordForward:"; /* Ctrl + RightArrow */
"$^\UF702" = "moveWordBackwardAndModifySelection:"; /* Shift + Ctrl + Leftarrow */
"$^\UF703" = "moveWordForwardAndModifySelection:"; /* Shift + Ctrl + Rightarrow */
}
For command line terminal
- Open terminal.
- Press cmd, for preferences.
- Profiles->keyboard +
- home: \033[H
- end: \033[F
- You can get the \033 part by hitting the escape key within the edit dialog, if you need to add it.