macosemacszshspacemacs

How to open a file in emacs from the terminal without a new instance of emacs opening?


Does anyone know why my terminal opens a new instance of emacs whenever I run emacs "filename" from my terminal?

My google results about the issue showed too many occurrences of people trying to do this liberately, but my emacs is doing this by default for some reason.

I've found no resolving cases in my init.el or ~/.zshrc


Solution

  • If emacs is already running, you can start a server (M-x start-server) from within emacs, and open files with emacsclient on the command line. You may create an alias for that.

    Spacemacs has a dotspacemacs-enable-server setting in your init.el file (SPC f e d) to always enable the server.