Skip to content

Instantly share code, notes, and snippets.

@mpoisot
Created April 10, 2012 16:21
Show Gist options
  • Save mpoisot/2352577 to your computer and use it in GitHub Desktop.
Save mpoisot/2352577 to your computer and use it in GitHub Desktop.
Mac OSX Home & End Keybindings
Create or add to ~/Library/KeyBindings/DefaultKeyBinding.dict
{
/* Remap Home / End to be correct :-) */
"\UF729" = "moveToBeginningOfLine:"; /* Home */
"\UF72B" = "moveToEndOfLine:"; /* End */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
}
For terminal, add to Terminal->Preferences->Settings->Keyboard
(There are more fixed for pgup, pgdown, shift-home, etc. I haven't tried them yet.)
home: \033[1~
end: \033[4~
And create a ~/.inputrc file to finish fixing the terminal. (I'm not sure if this eliminates the need for the Terminal keyboard preferences above.)
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
set completion-ignore-case On
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment