Created
February 20, 2018 13:51
-
-
Save ambakshi/2b00e957afaa346f099c57a7ec3bb948 to your computer and use it in GitHub Desktop.
Fixes the osx home/end keys so they work the way they do on Linux/Windows.
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
#!/bin/sh | |
mkdir -p ~/Library/KeyBindings | |
cd ~/Library/KeyBindings | |
if test -e DefaultKeyBinding.dict; then | |
echo >&2 "WARNING: Skipping customizing key bindings. $(pwd)/DefaultKeyBinding.dict already exists" | |
exit 0 | |
fi | |
cat > DefaultKeyBinding.dict <<'EOF' | |
{ | |
"\UF729" = moveToBeginningOfParagraph:; // home | |
"\UF72B" = moveToEndOfParagraph:; // end | |
"$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home | |
"$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end | |
"^\UF729" = moveToBeginningOfDocument:; // ctrl-home | |
"^\UF72B" = moveToEndOfDocument:; // ctrl-end | |
"^$\UF729" = moveToBeginningOfDocumentAndModifySelection:; // ctrl-shift-home | |
"^$\UF72B" = moveToEndOfDocumentAndModifySelection:; // ctrl-shift-end | |
} | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment