These work (almost) universally in every application in MacOS, the only exception is text editors, which usually prefer their own key bindings.
Interestingly, these are all the same shortcuts you can use in the terminal (through readline), and are the standard key bindings for emacs.
Ctrl + a
: go to the beginning of the lineCtrl + e
: go to the end of the lineCtrl + n
: down (same as down arrow)Ctrl + p
: up (same as up arrow)Ctrl + k
: delete from the cursor to the end of the lineCtrl + f
: move forward one character (like the right arrow)Ctrl + b
: move backwords one character (like the left arrow)Ctrl + d
: delete character after the cursor (like fn + backspace)Ctrl + h
: backspaceCtrl + t
: swap the places of the two characters behind the cursor