For a while now I’ve been searching for a simple lightweight text editor to use when editing configuration files as root and when SSH-ing to remote machine. My normal editor is GNU Emacs with 15+ years of accumulated baggage which makes it pretty slow to start up. I’ve tried the various workarounds like the Emacs daemon and TRAMP but it still feels like a lot of faff compared to just SSH and starting an editor. I’ve also tried nano and vi, but my Emacs muscle memory makes them too annoying to use.
Recently I’ve settled on mg, a venerable Emacs clone that’s maintained as part of the OpenBSD base system and also available on Linux.
It starts up instantly and with the minor configuration tweaks below is pretty ergonomic.
global-set-key "\^z" undo global-set-key "\^?" delete-backward-char global-set-key "\^h" delete-backward-char global-set-key "\e[1;3C" forward-word global-set-key "\e[1;3D" backward-word global-set-key "\e[1;5C" forward-word global-set-key "\e[1;5D" backward-word auto-execute *.c c-mode auto-execute *.h c-mode make-backup-files 0 set-default-mode indent set-fill-column 72