3 ms·
If you want a little more terminal magic here are my emacs related shortcuts: alias et='TERM=xterm-256color emacsclient -t' alias ec='emacsclient -c -a=ema
by mijoharas 10y ago
If you want a little more terminal magic here are my emacs related shortcuts:
alias et='TERM=xterm-256color emacsclient -t'
alias ec='emacsclient -c -a=emacs'
alias ed='emacs --daemon'
alias kill-emacs='emacsclient -e "(kill-emacs)"'
alias e='TERM=xterm-256color f -e "emacsclient -c -a=emacs"'
The reason for these is that emacs is a little slow to start up (in comparison to vim at least). So you can set up a daemon running ( ed command above, for emacs daemon. I don't have ed on my system)
You can then open up a new frame (window) of emacs with the ec command, or a new terminal session of emacs with the et command.
My favourite is the e command, which makes use of fasd[0] to find any "frecent" file, tries to open it with emacsclient, but, if emacs daemon is not running will fall back to opening a new emacs (which with spacemacs will start a new daemon running). This way I can open files in completely different directories if need be.
[0] https://github.com/clvv/fasd https://github.com/clvv/fasd
- akkartik 10y agoThanks for those tips! Just to contribute back a factoid in case you weren't aware, I noticed that the manpage for emacsclient says this: "If the value of [the alternate editor] is the empty string, run `emacs --daemon' to start Emacs in daemon mode, and try to connect to it." So your aliases would continue to work if you replace -a=emacs with -a=''. And you'd only pay the startup cost the first time you run ec or e.