Skip to content

Instantly share code, notes, and snippets.

Created February 20, 2018 13:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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.
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment