DEV Community

Alex Yaroslavsky
Alex Yaroslavsky

Posted on

1

Making Home and End keys work on Mac

Fix for most applications

Open a terminal window:

cd ~/Library
mkdir KeyBindings
cd KeyBindings
pico DefaultKeyBinding.dict
Enter fullscreen mode Exit fullscreen mode

Copy the contents of the text below to the file, press Ctrl-X to exit the editor and select Y to save:

{
/* 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:"; 
}
Enter fullscreen mode Exit fullscreen mode

Fix for Terminal

Open terminal and go to preferences. Select the profile you use and go to the keyboard tab. Look for the the entries with actions \033b (home) and \033f (end) and edit them. When you edit them, select key Home or End respectively and modifier none.

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay