Make your Home and End keys work like Windows

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!

I know this a very old topic, but I have found the different behavior of home and end annoying as well.
Well, maybe not annoying, but I keep trying to use them the way windows does it.
However, when I create these shortcuts they always get created as fn+home.end and they just don't work correctly.
I was hoping somebody m might have an idea why.
I've tried hooking up a keyboard that has actual home/end buttons as my MacBook Pro does not, but they are still the same.

Any help is appreciated.

Screenshot_2020-07-12 14.44.01_q2jI4f

Having the same issue. I manage to get "start of line" and "end of line" working, but can't add functionality to create "start of page" and "end of page". Is there a (good) way to file this as a bug?

This is my configuration:

I use terminal emulators a lot and the Home/End keys work well without any modifications there so I created an app group with the following configuration:

And such group has the following shortcuts:

CleanShot 2021-06-12 at 06.51.43

My keys had been working without issue even when recognized as fn+ BUT, I had to change my configuration to support some old hardware/software and it turns out that this setting:

Being enabled is the culprit or they not working as before, I guess I have to decide whether I want to use that or not, maybe having a script that enables/disables the setting when pressing certain shortcut would be fine, but well