Make your Home and End keys work like Windows

keyboard

#1

On Mac, Home and End take your cursor to the beginning or end of the current PAGE you're editing.
On Windows, Home and End take your cursor to the beginning or end of the current LINE you're editing.

I like the Windows behavior better.

NOTE: you can get the same behavior from command + left arrow and command + right arrow, but I prefer the actual Home and End buttons to work this way.

To make this work, I added 2 triggers:

  1. When the Home button is pressed, it maps to the key combo: command + left arrow
  2. When the End button is pressed, it maps to the key combo: command + right arrow

This setup mostly worked great, but there were some cases where they were still behaving like default Mac keys.

I eventually realized that it was when I was holding Shift and pressing Home or End, to highlight a line, that it wasn't working, and it was highlighting the whole page. To address this, 2 more triggers are needed:

  1. When the key combo of Shift + Home is pressed, it maps to the key combo: shift + command + left arrow
  2. When the key combo of Shift + End is pressed, it maps to the key combo: shift + command + right arrow

So the main lesson here is you need to make each key combo you want to use your re-mapped home or end keys with, not just the keys by themselves.

Thanks!