Skip to content

Instantly share code, notes, and snippets.

@mohitt
Created July 11, 2020 16:47
Show Gist options
  • Save mohitt/ef7164893f6c2696c456b2cf8dc3c86e to your computer and use it in GitHub Desktop.
Save mohitt/ef7164893f6c2696c456b2cf8dc3c86e to your computer and use it in GitHub Desktop.
Home keys mapping mac

https://damieng.com/blog/2015/04/24/make-home-end-keys-behave-like-windows-on-mac-os-x

If, like me, you want Home to send you to the start of the line and not to the top of the document then create a file called DefaultKeyBinding.dict in your ~/Library/KeyBindings folder (might need to create that folder too) with the following contents:

{
  "\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