Skip to content

Instantly share code, notes, and snippets.

@adam-edison
Last active March 20, 2024 21:39
Show Gist options
  • Save adam-edison/588c225997385e1874a94ef0913b2593 to your computer and use it in GitHub Desktop.
Save adam-edison/588c225997385e1874a94ef0913b2593 to your computer and use it in GitHub Desktop.
Terminal command to remap MacOS keybindings with PC Keyboard
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment