Back to Spacevim

SpaceVim CtrlSpace layer

docs/layers/ctrlspace.md

2.4.05.1 KB
Original Source

Available Layers >> ctrlspace

<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc -->

Description

This layer is a customized wrapper for CtrlSpace, a plugin dedicated to project navigation and workflow management, rather than a traditional fuzzy finder like Denite or FZF. CtrlSpace strictly manages 5 source lists only:

  • Buffers
  • Files
  • Tabs
  • Workspaces (vim session for current project)
  • Bookmarks (projects)

CtrlSpace has the unique property of allowing users to stay within it after it has been invoked once (similar to SpaceVim's own Transient Modes). Thereby granting you the ability to open multiple files, move/copy many buffers to new tabs, change to your various project bookmarks, and any combinations of its various actions, all without needing to reinvoke it.

Install

To use the CtrlSpace layer, add the following to your configuration file.

toml
[[layers]]
name = "ctrlspace"

Layer Options

  • home-mapping-key (default: <C-Space>) - keybinding to enter CtrlSpace's home menu, which displays the buffers list

  • autosave-workspaces (default: true) - enable this to autosave current workspace on switching WS and exiting SpaceVim

  • autoload-workspaces (default: false) - enable this to autoload last workspace when starting SpaceVim

  • For more granular CtrlSpace options, refer to the plugin's GitHub page.

  • enable-spacevim-styled-keys (default: false) - enable this to use SpaceVim styled keybindings.

Note: when disabled, another traditional fuzzy finder layer (such as Denite or FZF) may still be used without concerns of keybinding conflicts.

Keybindings: CtrlSpace Defaults

From Vim's Normal mode, <home-mapping-key> enters CtrlSpace in its home (buffers) list. Then using the following key shortcuts, all 5 lists can be accessed via any of the other 4. Press ? to show key reference for the current list and mode (ex. search mode of files list).

KeybindingsDescriptions
htoggle view home (buffers) list
Henter home (buffers) list in search
otoggle view project files list
Oenter project files in search
ltoggle view tabs list
Lenter tabs search in search
wtoggle view workspaces list
Wenter workspaces list in search
btoggle view bookmarks list
Benter bookmarks list in search
/toggle search mode for current list
?display help for current list and mode

To exit CtrlSpace, press <Esc>, <C-c> or <home-mapping-key> at anytime.

For more comprehensive documentation of CtrlSpace's keys, features and functionalities, refer to this guide.

Keybindings: SpaceVim Styled

For those who prefer to use SpaceVim's style of fuzzy finding buffers/files/projects, the following keybindings can be optionally enabled with enable-spacevim-styled-keys = true.

KeybindingsDescriptions
SPC b Llist tab-local buffers
SPC b lsearch tab-local buffers
SPC b Blist all buffers
SPC b bsearch all buffers
SPC f Flist files in dir of current buffer
SPC f fsearch files in dir of current buffer
SPC p Flist project files
SPC p fsearch project files
SPC w Tlist tabs
SPC w tsearch tabs
SPC p Wlist workspaces
SPC p wsearch workspaces
SPC p Blist project bookmarks
SPC p bsearch project bookmarks

Note: to be consistent with other fuzzy finder layers in SpaceVim, uppercased final keys will list the source, while lowercased ones will search. This is opposite to CtrlSpace's default shortcuts.