Created
October 8, 2024 15:39
-
-
Save sreyemnayr/a27e07f70fdb701170e11097e02cbd17 to your computer and use it in GitHub Desktop.
Make Home and End keys behave as expected on macOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p $HOME/Library/KeyBindings | |
echo '{ | |
/* Remap Home / End keys to be correct */ | |
/* Credit: radamo59 */ | |
/* https://discussions.apple.com/thread/251108215?login=true&sortBy=rank */ | |
"\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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run in terminal on new macOS installs to make Home/End behave as folks accustomed to Windows keybindings expect.