mg Text Editor
Wikipedia (via Accidental Tech Podcast):
mg, originally called MicroGnuEmacs (and later changed at the request of Richard Stallman), is a public-domain text editor that runs on Unix-like operating systems. It is based on MicroEMACS, but intended to more closely resemble GNU Emacs while still maintaining a small memory footprint and fast speed.
I’ve been occasionally annoyed, since Catalina, that Emacs is no longer built into macOS. Yes, it can be installed, but it was nice to be able to depend on it always being there. Fortunately, mg is pre-installed and seems to be a good substitute for my purposes of quickly doing small searches or edits from Terminal or via SSH.
Previously:
4 Comments RSS · Twitter · Mastodon
Well, TIL. I had absolutely zero idea mg was a thing, I need to see how usable it is since pico is getting on my nerves a bit (when I can’t use vim).
I had no idea mg was shipped with macOS, thanks. Long ago I made some contributions to the Amiga port, so kinda nostalgic.
Well, it actually _has_ UTF-8 capabilities, even if I wouldn't call it support. Mg is agnostic about the character set. If you give the command
M-x meta-key-mode
it will toggle (default on) whether it reads "meta commands". When you press your meta key, it will add the "8th bit" to the character you press, which "destroys" the ability to handle other character sets than plain 7-bit ASCII. Normally mg will interpret that as "the 8th bit is set --> the user pressed meta --> this is a command, not a character". If you turn off meta-key mode, mg will put the characters in the buffer exactly as typed, so whatever non-ASCII characters you enter, they will end up in the buffer. The drawback is that your meta key no longer works a modifier key. It will only put strange characters in your buffer. You will have to resort to using ESC- for meta commands instead. It's a trade-off.