Nano:
There are many editors available. nano is easy to use and works on both the MacBook and Raspberry PI. nano works well in a terminal window when connected from a MacBook to a Raspberry Pi using ssh.
Any editor can be used.
Common nano commands:
CTRL-w - find
CTRL-w, CTRL-r - replace
CTRL-o - write file
CTRL-x - exit
CTRL-_ - go to line number
CTRL-k - delete line