spacemacs layout
December 29, 2020
About spacemacs layout
-
I always open several windows that contains many buffers when doing project A. When I want to temporarily switch to project B, I had close all the buffers for A, and then reopen files that belogs to project B. But after playing with B, I return to A with no idea about what I’ve done before and about what buffers should I open.
-
So is there a way to keep buffers belogs to different projects in different, Eh, workspace or something like that?
-
Yes, it is called layout
-
Layouts are window configurations with buffer isolation, each layout can define several workspaces(think of them as sub-layouts) sharing the same list of buffers as their parent layout.
Basic Commands (Layout)
space l s: save current layout to a filespace l L: restore layout from a filespace l: activate transient-state- under transient state
?: toggle the documentation[1..9 0]: swith to nth layoutd: delete the current layout and keep its buffersD: delete the other layouts and keep their buffersx: kill current layout with its buffersX: kill other layouts with their buffersR: rename current layout
introduction for workspace
- Workspaces are sub-layouts, they allow to define multiple layouts into a given layout, those layouts share the same buffer as the parent layout
Basic Commands (Workspace)
space l w: activate the transient state?: toggle the documentation[1..9, 0]: switch to nth workspace[C-1..C-9, C-0]: switch to nth workspace and keep the transient state actived: close current workspacen/l: switch to next workspaceN/p/h: switch to previous workspaceR: set a tag to the current workspace *w: switch to tagged workspacegt: go to next workspacegT: go to previous workspacespace b W: go to workspace and window by buffer
Mode Line Command
space t m b: toggle the battery statusspace t m c: toggle the org task clockspace t m m: toggle the minor mode lightersspace t m M: toggle the major mode