14 ms·
I took the opposite extreme approach (and I think this is fairly common): Launch emacs once ever and use emacsclient for the typical short-duration invoke/shut
by sokoloff 11y ago
I took the opposite extreme approach (and I think this is fairly common):
Launch emacs once ever and use emacsclient for the typical short-duration invoke/shutdown use cases.
- NoGravitas 11y agoLikewise. I start emacs --daemon from systemd, and have aliases for using emacsclient to open emacs in a new frame, in the current terminal, or in a new screen window.
- theophrastus 11y agoIf you have any details, links, hints about how to accomplish this (for instance, where does one find a proper "emacsclient.service" file?) please consider yourself emboldened
- wging 11y agoStarting from systemd is a league beyond what I've done. But you might like this script: #!/bin/sh emacsclient -t $@ || (emacs --daemon && emacsclient -t $@) You'll want something like (unless (server-running-p) (server-start)) in your init file.
- tbirdz 11y agoOr use emacsclient -t --alternative-editor="" and emacsclient will start the daemon if it hasn't already been started. You can also set the ALTERNATIVE_EDITOR environment variable to "" to achieve the same effect.
- davexunit 11y agoI don't have a systemd example, but here's a GNU dmd service that I use which shows how to properly start/stop the daemon: https://git.dthompson.us/dotfiles.git/blob/HEAD:/dotfiles/.dmd.d/init.scm#l147 https://git.dthompson.us/dotfiles.git/blob/HEAD:/dotfiles/.d...
- qiushihe 11y agoI had a slightly different approach in that I made a script to launch Emacs server on-demand: https://github.com/qiushihe/dotpiles/blob/master/emacs/emacsl.sh https://github.com/qiushihe/dotpiles/blob/master/emacs/emacs...
- NoGravitas 11y agoI use the system service (emacs@.service) from [this blog post][0]. I used 'systemctl enable emacs@myusername.service' so that emacs is always started on boot. I have a one-liner shell script called 'em' that just runs 'emacsclient -t $*' so that it can be set as $VISUAL and used by whatever command line tools use that. [0]: http://blog.refu.co/?p=1296 http://blog.refu.co/?p=1296
- krylon 11y agoMe too. Well, once per reboot. Even under very good circumstances, Emacs' startup time is worse than mg or vi. And having it run in the background, keeping its state, open buffers, shell history, etc. is very convenient.
- kbutler 11y agoThis. This emacsclient startup time is excellent. The complaint that each launched client shares the same buffers is hardly sufficient to justify the effort of lazy loading to achieve only mediocre performance.
- DannoHung 11y agoSince I moved to spacemacs, I've been doing this. However, I am bummed by emacsclient's inability to open multiple files from the command line. And apparently the total lack of a Tab-like experience on Emacs in general. I used to use "vim -p" SO MUCH.
- ithkuil 11y agowhat's wrong with http://www.emacswiki.org/emacs/TabBarMode http://www.emacswiki.org/emacs/TabBarMode ?
- eeperson 11y agoTab bar mode conflicts with a bunch of other modes. So a lot of times you will switch to a buffer and and the tabs will disappear. It also doesn't support 'most recent' tab ordering.
- DannoHung 11y agoSeems like that only really works for GUI emacs. I use command line. I tried enabling it and it doesn't seem to, y'know, work. I've also tried evil-tabs, which doesn't work with spacemacs, at all. And eyebrowse doesn't actually use tabs (also it doesn't maintain working directory state when opening a new workspace, fun!) I dunno, emacs is very much, "Here's a half-implemented solution that pays zero attention to ergonomics. Just... y'know, fix the rest of it so it doesn't totally suck." And I just don't have the experience to do that yet. Which is why I'm using Spacemacs. Which more or less actually tries to do the ergonomics correctly. edit: I'm also hoping Cunningham's Law works in my favor here.
- eeperson 11y agoIn the spirit of Cunningham's Law, you can open multiple files using emacsclient. Just list them after emacsclient (e.g. 'emacsclient file1.txt file2.txt'). This will open each file in its own buffer (roughly the equivalent to tabs). Since I'm not very familiar with vim tabs, I'm curious what you get using using vim tabs that you don't get out of emacs buffers?