Fork me on GitHub
#spacemacs
<
2020-04-24
>
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

sgepigon13:04:12

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

sgepigon13:04:29

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
practicalli-johnny14:04:19

@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). https://practicalli.github.io/spacemacs/spacemacs-basics/working-with-projects/layouts.html 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”?

practicalli-johnny16:04:15

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?

mccraigmccraig17:04:55

you can also use http://wikemacs.org/wiki/Emacs_server 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

practicalli-johnny19:04:45

Yes, Spacemacs has a persistent server available via a simple config in .spacemacs file https://practicalli.github.io/spacemacs/install-spacemacs/emacsclient-server.html

practicalli-johnny19:04:19

@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.