Skip to content

Instantly share code, notes, and snippets.

@akersten
Created February 5, 2024 15:56
Show Gist options
  • Save akersten/fe279d0972dd7b7ab0889d12c9041eab to your computer and use it in GitHub Desktop.
Save akersten/fe279d0972dd7b7ab0889d12c9041eab to your computer and use it in GitHub Desktop.
OSX fix text editing keybinds
# First switch command + alt + control keys to their proper positions in Settings
# mkdir ~/Library/KeyBindings
# cd ~/Library/KeyBindings
# vi DefaultKeyBinding.dict
{
"\UF729" = moveToBeginningOfLine:; // home
"\UF72B" = moveToEndOfLine:; // end
"$\UF729" = moveToBeginningOfLineAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfLineAndModifySelection:; // shift-end
"@\UF702" = moveWordBackward:;
"@\UF703" = moveWordForward:;
"@$\UF702" = moveWordBackwardAndModifySelection:;
"@$\UF703" = moveWordForwardAndModifySelection:;
"~\UF702" = moveToBeginningOfLine:;
"~\UF703" = moveToEndOfLine:;
"~$\UF702" = moveToBeginningOfLineAndModifySelection:;
"~$\UF703" = moveToEndOfLineAndModifySelection:;
"@\U007F" = "deleteWordBackward:"; /* Cmd + Backspace */
"@\UF728" = "deleteWordForward:"; /* Cmd + Delete */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment