Skip to content

Instantly share code, notes, and snippets.

@juanplopes
Created March 22, 2022 12:36
Show Gist options
  • Save juanplopes/e14884856ca1062e3aa7115857512210 to your computer and use it in GitHub Desktop.
Save juanplopes/e14884856ca1062e3aa7115857512210 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
mkdir -p ~/Library/KeyBindings
cat > ~/Library/KeyBindings/DefaultKeyBinding.dict << EOF
{
/* 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 */
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment