Skip to content

Instantly share code, notes, and snippets.

@dvdotsenko
Last active February 7, 2021 03:21
Show Gist options
  • Save dvdotsenko/41ad1eaa980cde9b3942744353b54ddf to your computer and use it in GitHub Desktop.
Save dvdotsenko/41ad1eaa980cde9b3942744353b54ddf to your computer and use it in GitHub Desktop.
// in console it's different.
// Enabled "Option as Meta" and
// add /0001 (CTRL A) as Home and /00005 (CTRL E) as End
// https://stackoverflow.com/questions/327664/mac-os-x-terminal-map-optiondelete-to-backward-delete-word
cd ~/Library
mkdir KeyBindings
cd KeyBindings
nano DefaultKeyBinding.dict
{
/* Remap Home / End keys */
/* Home Button*/
"\UF729" = "moveToBeginningOfLine:";
/* End Button */
"\UF72B" = "moveToEndOfLine:";
/* Shift + Home Button */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
/* Shift + End Button */
"$\UF72B" = "moveToEndOfLineAndModifySelection:";
/* Ctrl + Home Button */
"^\UF729" = "moveToBeginningOfDocument:";
/* Ctrl + End Button */
"^\UF72B" = "moveToEndOfDocument:";
/* Shift + Ctrl + Home Button */
"$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:";
/* Shift + Ctrl + End Button*/
"$^\UF72B" = "moveToEndOfDocumentAndModifySelection:";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment