I've been doing this for >10 years with https://manytricks.com/butler/. Works great! You can also bind snippets of text, scripts, etc.
I can't overstate how important it is to have a keyboard that groups function keys into "islands" of (generally) 4 so you can touch-type them. An ergonomics consultant once observed that the source of my neck pain was that I looked at the keyboard while typing. As a touch-typist, I found this puzzling—until we realized it was just the function keys. :-)