ikyhag
Last Updated: September 21, 2016
·
407
· colindean
E3c791e8e5da39bf88b09dfb089de01b

Fixing HOME and END keys, and more, on macOS

Run this at the command line, perhaps within Terminal or iterm2:

mkdir -p $HOME/Library/KeyBindings
echo '{
/* Remap Home / End keys to be correct */
"\UF729" = "moveToBeginningOfLine:"; /* Home */
"\UF72B" = "moveToEndOfLine:"; /* End */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
"^\UF729" = "moveToBeginningOfDocument:"; /* Ctrl + Home */
"^\UF72B" = "moveToEndOfDocument:"; /* Ctrl + End */
"$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Shift + Ctrl + Home */
"$^\UF72B" = "moveToEndOfDocumentAndModifySelection:"; /* Shift + Ctrl + End */
}' > $HOME/Library/KeyBindings/DefaultKeyBinding.dict

Restart, and enjoy working HOME and END keys.

Not a fan of the command line? Try KeyFixer.

Inspired by and simplified from How to fix home and end keys on Mac OS X.

Say Thanks
Respond