Use Emacs in terminal
I usually use the Emacs GUI to manage and edit files for each project. The GUI version looks great and works great.
However, I have to use Vim in the terminal since it starts much faster than Emacs. I have tried with Emacs daemon in the past, but I met some weird issues when connecting GUI Emacs to the daemon. Some of the function does not work very well.
I used the combination of Vim and Emacs for a very long time until yesterday. I realized why I don't use Emacs daemon in the terminal while using Emacs GUI without the daemon.
The setup is quite simple. Add the codes below to your .emacs file. It will use a different server name and theme for the Emacs daemon.
1(if (daemonp)
2 (setq server-name "term")
3 (setq server-name "server")
4 )
5
6(if (not (display-graphic-p))
7 (setq doom-theme 'modus-vivendi)
8 (setq doom-tmeme 'theme-for-GUI))
If you use emacs-plus on Mac, you can start the daemon by the command brew services start emacs-plus@29
. Now let's set some alias
1alias vi="emacsclient -nw -s 'term'"
2alias vim="emacsclient -nw -s 'term'"
After that, you can edit the file with the command vim <file-name>
.