Launch emacs once ever and use emacsclient for the typical short-duration invoke/shutdown use cases.
Launch emacs once ever and use emacsclient for the typical short-duration invoke/shutdown use cases.
#!/bin/sh
emacsclient -t $@ || (emacs --daemon && emacsclient -t $@)
You'll want something like (unless (server-running-p)
(server-start))
in your init file. 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.https://git.dthompson.us/dotfiles.git/blob/HEAD:/dotfiles/.d...
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.
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.
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.
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?
Because you never ever start vim in a daemon mode, opening with -p creates a local list of files that you can cycle amongst. Additionally, the top line tells you which file you have open and which files are next and previous in the list of files you cycle through.
I've always just found it rather nice since I tend to jump around between the same handful of files while I'm working and hitting gt two or three times is often faster and more mindless than remembering the keystrokes to invoke helm-projectile-find-file and also the name of the file I want to switch to.
[1] - https://github.com/jwiegley/use-package [2] - https://github.com/jrosdahl/iflipb
emacs buffers are (almost exactly) equivalent to vim buffers. vim tabs don't really have an analogue in emacs, but imagine several layouts of (emacs) windows (each window showing a single buffer) you can switch between in a single frame.