Layouts and Workspaces
Layouts provide an easy way to group buffers for a project or any arbitrary buffer grouping you wish. Workspaces define window arrangements within a particular layout.
Working with buffers in a layout
SPC b b shows only the buffers for the current layout, making it easy to switch between them.
SPC b B will show all buffers.
SPC TAB will toggle between the previous buffer and current buffer, regardless of layer the previous buffer is in. Add
(spacemacs-layouts :variables spacemacs-layouts-restrict-spc-tab t) to the
dotspacemacs-configuration-layers in your
.spacemacs file to limit
SPC TAB to buffers of the current layer.
SPC l TAB switches to the previous layout, providing a quick way to jump between two projects actively being worked on.
SPC l enters the layout transient state
SPC l l lists the current layers with a helm prompt to narrow the list. Entering a new name will prompt to create a new layout (perspective)
The current layout name appears on the far left of the mode-line.
SPC l s saves the current layouts to a file,
SPC l L loads a layout from a file. Layouts are kept when restarting Spacemacs with
SPC q r and can be configured to auto-resume when starting Emacs.
SPC l x kill current layout with its buffers,
SPC l d deletes the layer and keeps the buffers available
SPC l ? will show the help menu
SPC b b in the
default layout shows all open buffers as this layout has global scope.
This layout is useful to check if there are unsaved files or for killing unwanted or temporary buffers.
M-SPC when helm popup is active opens the helm transient state.
t will mark (tag) an item in the list,
T will mark all items.
M-D will kill all marked buffers.
Workspaces define multiple window arrangements in a given layout. The active workspace number is placed before the window number, i.e ➊|➍, the fourth window of the first workspace. Any new layout comes with a default workspace, ➊|➊. Switching to a workspace that does not exist in the current layout will create a new one.
SPC l w R gives a name to the current workspace.
Pressing a workspace number will activate it or create a new one.
Ctrl-<number> will preview a workspace.
TAB makes the previous workspace activate.
SPC l w ? to toggle the full help.
There are also some handy globally available key bindings related to workspaces:
||go to next workspace|
||go to previous workspace|
||go to workspace and window by buffer|