I open a new shell using space-'. From that shell window I can type ls to see files. Let's say I want to edit ~/.zshrc. From the shell prompt, what do I type to edit that file in a new buffer in the main window?

Note - I do not want to browse to the file location again using space-f-f, as I might be several dirs deep. And typing emacs <filename> opens a new instance of Emacs. vim <filename> works close to what I want.

I'm using Macos with the d12frosted homebrew install of Emacs.

1 Answer 1


Add export ALTERNATE_EDITOR="" #Causes Emacs to start a daemon if one is not found. to somewhere your system shell sources (e.g., ~/.profile_bash). Then you can use emacsclient "PATH" to open a file in your current emacs session.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.