3 ms·
emacs --daemon and EDITOR='emacsclient'
by packetslave 11y ago
emacs --daemon and EDITOR='emacsclient'
- leppr 11y agoalias emacs="emacsclient -nw -a ''" is the best I've found. -nw: Open a new frame in current terminal (otherwise it just opens the file in whatever other emacs window you already have launched). -a: Start the daemon if it isn't running. '': Little trick so you can launch it without a filename.
- philsnow 11y ago-a: Start the daemon if it isn't running. '': Little trick so you can launch it without a filename. Ha, if only. From the bit on `-a` in https://www.gnu.org/software/emacs/manual/html_node/emacs/emacsclient-Options.html https://www.gnu.org/software/emacs/manual/html_node/emacs/em... : Specify a command to run if emacsclient fails to contact Emacs. This is useful when running emacsclient in a script. As a special exception, if command is the empty string, then emacsclient starts Emacs in daemon mode (as emacs --daemon) and then tries connecting again. `emacsclient -a vim` will run vim if it can't connect to a running daemon.