Fork me on GitHub
Yehonathan Sharvit12:04:54

Is there a way to prevent spacemacs from reopening buffers from previous session?

Yehonathan Sharvit12:04:05

I run spacemacs from the command line

Yehonathan Sharvit12:04:40

I have multiple spacemacs running from different folders and buffers from different sessions are mixed together which causes quite a big mess


SPC q R? It calls restart-emacs instead of restart-emacs-resume-layouts (`SPC q r`)


You can also try and set dotspacemacs-auto-resume-layouts nil in your .spacemacs (probably more relevant given you’re on the command line)

Yehonathan Sharvit13:04:39

awesome @sgepigon Thanks a lot

👍 4

@viebel It seems you are using Spacemacs in a terminal rather than as a GUI? It also sounds like you are using Spacemacs like Vi/Vim if you are only opening things from the command line, which seems very inefficient and probably slower than it should be. Unless you have a constraint, consider running Spacemacs as a single GUI app and take a look at Spacemacs layouts to organise multiple projects. A layout can contain all the buffers relative to a project and commands are relative to the project that the layer contains. I currently have 27 layouts which are all individual projects I regularly work on (or should be working on). If there is a need to use Spacemacs in a terminal window, then perhaps layouts would still be useful. Its not something I tried.

Yehonathan Sharvit14:04:19

@jr0cket what do you mean by “runnning spacemacs from the command line would be inefficient and slower than it should be”?


It sounds like you are starting multiple instances of Spacemacs and doing so quite regularly. Rather than running one instance of Spacemacs once and leaving it running. Is this not the case?


you can also use to run a single daemon instance of emacs and connect command-line clients to that, which should be as resource efficient as a single GUI


Yes, Spacemacs has a persistent server available via a simple config in .spacemacs file


@viebel I was particularly confused about the "multiple Spacemacs running" as this suggests multiple separate instances of Emacs. Which in turn suggests the Spacemacs configuration and packages are loaded into memory for each instance. If it's all working fine and is fast, then ignore my concerns.