Skip to content

Instantly share code, notes, and snippets.

@wizioo
Last active January 7, 2016 15:27
Show Gist options
  • Save wizioo/2871238f1e9bd4f21286 to your computer and use it in GitHub Desktop.
Save wizioo/2871238f1e9bd4f21286 to your computer and use it in GitHub Desktop.
Use Windows Behaviour for Home and End Keys on OSX keyboard

#Use Windows Behaviour for Home and End Keys on OSX keyboard

Allow user to use "Home" & "End" keys and mix it with cmd and shift. This allow the user to bring Windows behavour to this keys.

Configuration

Just copy DefaultKeyBinding.dict in ~/Library/KeyBindings (folder has to be created)

Associations created

  • Home : go to beginning of line
  • End : go to end of line
  • Shift+Home : select from cursor until the beginning of line
  • Shift+End : select from cursor until the end of line
  • Ctrl+Home : go to beginning of file
  • Ctrl+End : go to end of file
  • Ctrl+Shift+Home : select from cursor until the beginning of file
  • Ctrl+Shift+End : select from cursor until the end of file
{
/*
Shift : \
Ctrl : ^
Alt : ~
Cmd : @
More at: http://osxnotes.net/keybindings.html
*/
"\UF729" = moveToBeginningOfParagraph:; // home
"\UF72B" = moveToEndOfParagraph:; // end
"$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
"@\UF729" = "moveToBeginningOfDocument:"; /* Cmd + Home */
"@\UF72B" = "moveToEndOfDocument:"; /* Cmd + End */
"$@\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Shift + Cmd + Home */
"$@\UF72B" = "moveToEndOfDocumentAndModifySelection:"; /* Shift + Cmd + End */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment