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 file
  • space l L: restore layout from a file
  • space l: activate transient-state
  • under transient state
  • ?: toggle the documentation
  • [1..9 0]: swith to nth layout
  • d: delete the current layout and keep its buffers
  • D: delete the other layouts and keep their buffers
  • x: kill current layout with its buffers
  • X: kill other layouts with their buffers
  • R: 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 active
  • d: close current workspace
  • n/l: switch to next workspace
  • N/p/h: switch to previous workspace
  • R: set a tag to the current workspace * w: switch to tagged workspace
  • gt: go to next workspace
  • gT: go to previous workspace
  • space b W: go to workspace and window by buffer

Mode Line Command

  • space t m b: toggle the battery status
  • space t m c: toggle the org task clock
  • space t m m: toggle the minor mode lighters
  • space t m M: toggle the major mode

source