DEV Community

loading...

If you need emacs on macOS Catalina or Big Sur

kennethlum profile image Kenneth Lum Updated on ・1 min read

Occasionally, we may still need emacs for small editing, but on Catalina or Big Sur, emacs is not available. There are some options: one is to use nano or vi instead. Another is to install emacs using Homebrew. The third option which can be simple is just to use mg. It is MicroGnuEmacs and when you use it, you can use the familiar keystrokes as in emacs.

Note it is already pre-installed on Catalina or Big Sur. There is no need to install it.

If you are used to typing e for emacs and using emacs for git, simply change the zsh alias in ~/.zshrc to

alias e='mg'
Enter fullscreen mode Exit fullscreen mode

and config git:

git config --global core.editor mg
Enter fullscreen mode Exit fullscreen mode

Discussion (10)

pic
Editor guide
Collapse
brandelune profile image
Jean-Christophe Helary

I'm pretty sure Catalina still had a version of emacs 22, but I just updated to BigSur so I can't check...

Collapse
kennethlum profile image
Kenneth Lum Author

are you sure... I was googling for it and it showed installing emacs using Homebrew on Catalina...

Collapse
brandelune profile image
Jean-Christophe Helary

No, you may be right, but since I upgraded to Catalina it was already there and the upgrade did not remove it. Plus I was mostly build in from source once in a while so I did not really pay attention.

Thread Thread
kennethlum profile image
Kenneth Lum Author • Edited

yeah, looks like you installed emacs 22 before you had Catalina...

Thread Thread
brandelune profile image
Jean-Christophe Helary • Edited

I think "Terminal" emacs 22 was installed by default all along. It was removed with Catalina.

Thread Thread
kennethlum profile image
Kenneth Lum Author

oh ok, when I saw emacs 22 I thought the GUI one... so the text based version is version 22...

Thread Thread
brandelune profile image
Jean-Christophe Helary

Yes, I think that's the one that came with GPL2. When it moved to GPL3, Apple stopped to upgrade it, or something like this.

Collapse
mgrygles profile image
Mary Grygleski • Edited

I am actually running into an error on Big Sur that says ".... Apple cannot check it for malicious software....". Does anyone know how to work around this? (I got mine from emacsformacosx.com)

Collapse
kennethlum profile image
Kenneth Lum Author

I think mg is already built in, as in, already installed on Big Sur

Collapse
stanley12qs profile image
stanley12qs

Yep, you're right about it.