Source: https://damieng.com/blog/2015/04/24/make-home-end-keys-behave-like-windows-on-mac-os-x
If you want Home to send you to the start of the line and not to the top of the document then create a file called DefaultKeyBinding.dict
in your ~/Library/KeyBindings
folder (might need to create that folder too) with the following contents.
This remapping does the following in most Mac apps including Chrome (some apps do their own key handling):
Home and End will go to start and end of line
ShiftHome and ShiftEnd will select to start and end of line
CtrlHome and CtrlEnd will go to start and end of document
ShiftCtrlHome and ShiftCtrlEnd will select to start and end of document
Note that you will need to reboot / kill Finder after creating this file for it to take effect.