Main page: spacevim.org

Github address: github.com/SpaceVim/Sp…

SpaceVim is a community-driven collection of modular VIM/Neovim configurations that contain multiple functional modules and have been optimized for Neovim. Spacevim has a variety of functional modules to choose from, and by selecting specific modules for each language, you can configure an environment suitable for that particular language.

You can submit an issue on Github if you encounter problems or have functional requirements, which will be easier to focus on and fix. We also welcome users who like Vim/ Neovim to join our QQ group to discuss viM-related skills. Click to join our Vim/SpaceVim group.

Here’s a roundup of developments in recent weeks:

Donations SpaceVim

WeChat Alipay

The following is SpaceVim Chinese manual, part of which has not been translated yet. In order to facilitate you to query relevant information, it has been published on the official website in advance, and will be gradually updated later. Thank you for your support all the time!

  • The installation
  • update
  • The document
    • core idea
      • Memory AIDS
      • Visual interaction
      • consistency
      • community-driven
    • Significant features
    • Shortcut navigation
    • Run a screenshot
      • The welcome page
      • Working interface
    • Who will benefit from SpaceVim?
    • Update and rollback
      • SpaceVim updates itself
        • Automatic updates
        • Update through plug-in Manager
        • Update via Git
      • Update the plugin
    • Configuration module
    • User configuration
      • Automatically generate user configurations
      • User Configuration directory
    • concept
      • Temporary shortcut key
    • Elegant interface
      • The theme
      • The font
      • Interface element switching
      • Status bar & TAB bar
        • The status bar
        • TAB bar
    • manual
      • Automatic completion
        • Unite/Denite
        • Shortcut keys in Unite/Denite buffer
      • interaction
        • shortcuts
          • Shortcut navigation
          • Browse shortcuts via Unite/Denite
        • Get help information
        • The available modules
          • Available plug-ins
          • Add a user-defined plug-in
        • Interface element display switch
      • Normal operation
        • The cursor
        • Quick jump
          • Quick skip to url (TODO)
        • A commonly used pair of shortcut keys
        • Jump, merge, split
          • jump
          • Merge, break up
        • The Windows operating
          • Common shortcut keys for window operation
        • File and Buffer operations
          • Shortcut keys for Buffer operations
          • Creating a blank buffer
          • Special buffer
          • File operation related shortcut keys
          • Vim and SpaceVim related files
        • The file tree
          • Common operations in a file tree
          • Open a file in the file tree
    • Commands starting with g
    • Commands starting with z
    • Auto-saving
    • Searching
      • With an external tool
        • Useful key bindings
        • Searching in current file
        • Searching in all loaded buffers
        • Searching in an arbitrary directory
        • Searching in a project
        • Background searching in a project
        • Searching the web
      • Searching on the fly
      • Persistent highlighting
    • Editing
      • Paste text
        • Auto-indent pasted text
      • Text manipulation commands
      • Text insertion commands
      • Commenting
      • Multi-Encodings
    • Errors handling
    • Managing projects
  • Achievements
    • issues
    • Stars, forks and watchers
  • Features
    • Awesome ui
    • Mnemonic key bindings
  • Language specific mode
  • Key Mapping
    • c/c++ support
    • go support
    • python support
  • Neovim centric – Dark powered mode of SpaceVim.
  • Modular configuration
  • Multiple leader mode
    • Global origin vim leader
    • Local origin vim leader
    • Windows function leader
    • Unite work flow leader
  • Unite centric work-flow
    • Plugin Highlights
    • Non Lazy-Loaded Plugins
    • Lazy-Loaded Plugins
      • Language
        • Commands
        • Commands
        • Completion
        • Unite
        • Operators & Text Objects
      • Custom Key bindings
        • File Operations
        • Editor UI
        • Window Management
        • Native functions
        • Plugin: Unite
        • Plugin: neocomplete
        • Plugin: NERD Commenter
        • Plugin: Goyo and Limelight
        • Plugin: ChooseWin
        • Plugin: Bookmarks
        • Plugin: Gina/Gita
        • Plugin: vim-signify
        • Misc Plugins
    • Modular configuration
    • Denite/Unite based platform
    • Automatic completion
    • Meticulous tags management
  • fast
    • SpaceVim options
    • read
      • Vim 8 New special new journey

The installation

Installing SpaceVim on Linux or Mac is as simple as executing the following command:

curl -sLf https://spacevim.org/install.sh | bashCopy the code

For more custom installation methods, see:

curl -sLf https://spacevim.org/install.sh | bash -s -- -hCopy the code

SpaceVim is a modular configuration that can run on vim or Neovim. For vim and Neovim installation, please refer to the following links:

Install neovim

Build Vim from source

Installation procedure in Windows:

In Windows, vim users only need to clone the warehouse as vimfiles in the user’s HOME directory. The default directory of CMD is the HOME directory by default. You only need to run the following command:

git clone https://github.com/SpaceVim/SpaceVim.git vimfiles
Copy the code

Under Windows, neovim users need to clone the warehouse into AppData\Local\nvim under the user HOME directory. If you want to obtain more knowledge about neovim installation, you can visit the Neovim wiki, which is very detailed. The default initial directory of CMD is the HOME directory. You only need to run the following command:

git clone https://github.com/SpaceVim/SpaceVim.git AppData\Local\nvim
Copy the code

The font

SpaceVim uses Powerline fonts by default. The default font file is DejaVu Sans Mono, which Windows users can download and install by right-clicking.

vimproc.dll

Under Windows users if not convenient compiled, can be in qq group inside the file to download the corresponding DLL file into the vimproc lib directory, default is ~ /. Cache/vimfiles/repos/github.com/Shougo/vimproc.vim/lib/

update

Spacevim and the included plug-ins can be updated with the :SPUpdate command, if the specified plug-ins need to be updated, such as: Vim :SPUpdate startuptime.vim or :SPUpdate SpaceVim to update SpaceVim

core idea

Four core ideas: memory assistance, visual interaction, consistency, community driven.

If the above four core ideas are violated, we will try to fix them.

Visual interaction

Innovative real-time keyboard shortcut assist system, and query system, easy to quickly query available modules, plug-ins and more information.

community-driven

Community driven to ensure the speed of bug fixes and new feature updates.

Shortcut navigation

SpaceVim doesn’t need to memorize any of the keyboard shortcuts, and has a powerful shortcut navigation system to remind you what each key does. For example, when you press the space bar in Normal mode, you will be prompted as follows:

This navigation prompt groups all shortcut keys prefixed with Spaces, such as B for all buffers and P for all project management shortcuts. Press < c-h > in navigation mode and you will see the corresponding help message in the status bar. The key description is as follows:

The keys describe
u Undo the previous key
n Navigation system next page
p Navigation system front page

Run a screenshot

Working interface

Neovim runs on iTerm2 using SpaceVim and base16-Solarized-Dark

Shows a common front-end development interface for development: JavaScript (jQuery), SASS, and PHP buffers.

The figure contains a Neovim terminal, a syntax tree window, a file tree window and a TernJS definition window

To see more screenshots, read issue #415

Who will benefit from SpaceVim?

  • Beginner Vim user.
  • Vim users looking for an elegant interface
  • Vim users seeking less muscle damage
  • Vim users who want to learn a different way to edit files
  • Vim users looking for a simple but highly configurable system

SpaceVim updates itself

SpaceVim’s core files can be updated in a number of ways. It is recommended to update all plug-ins before updating SpaceVim. The details are as follows:

Update through plug-in Manager

Using the :SPUpdate SpaceVim command will open SpaceVim’s plug-in manager and update SpaceVim, with the progress shown in the plug-in manager buffer.

Update the plugin

Using the :SPUpdate command will update all plug-ins, including SpaceVim itself. Of course, this command also supports parameters. The parameter is the plug-in name. You can add multiple plug-in names as parameters and use the Tab key to complete the plug-in name.

User configuration

The user configuration is saved in the ~/.spacevim.d/folder.

User Configuration directory

~/.spacevim. d/ will be added to Vim’s runtimepath &runtimepath. For details, read: H RTP.

Of course, you can also hold the user configuration directory with the environment variable SPACEVIMDIR. Of course, you can also change directory location through soft connection to configure backup.

SpaceVim also supports project local configuration, setting the birth file as.spacevim. d/init.vim in the current directory. Spacevim. d/ in the current directory will also be added to the Vim runtime path.

Here is an example of a user profile:

" Here are some basic customizations, please refer to the ~/.SpaceVim.d/init.vim
" file for all possible options:
let g:spacevim_default_indent = 3
let g:spacevim_max_column     = 80

" Change the default directory where all miscellaneous persistent files go.
" By default it is ~/.cache/vimfiles.
let g:spacevim_plugin_bundle_dir = '~/.cache/vimfiles'

" set SpaceVim colorscheme
let g:spacevim_colorscheme = 'jellybeans'

" Set plugin manager, you want to use, default is dein.vim
let g:spacevim_plugin_manager = 'dein'  " neobundle or dein or vim-plug

" use space as `<Leader>`
let mapleader = "\<space>"

" Set windows shortcut leader [Window], default is `s`
let g:spacevim_windows_leader = 's'

" Set unite work flow shortcut leader [Unite], default is `f`
let g:spacevim_unite_leader = 'f'

" By default, language specific plugins are not loaded. This can be changed
" with the following, then the plugins for go development will be loaded.
call SpaceVim#layers#load('lang#go')

" loaded ui layer
call SpaceVim#layers#load('ui')

" If there is a particular plugin you don't like, you can define this
" variable to disable them entirely:
let g:spacevim_disabled_plugins=[
\ ['junegunn/fzf.vim'].\ ]

" If you want to add some custom plugins, use these options:
let g:spacevim_custom_plugins = [
\ ['plasticboy/vim-markdown', {'on_ft' : 'markdown'}].\ ['wsdjeg/GitHub.vim'].\ ]

" set the guifont
let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11'Copy the code

More detailed SpaceVim options are available :h SpaceVim.

Temporary shortcut key

SpaceVim defines many temporary shortcuts as needed, which will avoid pressing the SPC front key too much when something needs to be repeated. When temporary shortcut keys are enabled, a shortcut window will open at the bottom of the window, indicating the functions of each temporary shortcut key. Some additional ancillary information will also be available.

Text move temporary shortcut:

Elegant interface

SpaceVim integrates various user interface plug-ins, such as the common file tree, syntax tree, etc., and the default color theme is Gruvbox.

The theme

SpaceVim’s default color theme is Gruvbox. This theme comes in both dark and light colors. Some detailed configurations on this topic can be read :h Gruvbox.

If you need to change the theme of SpaceVim, you can change g:g:spacevim_colorscheme in ~/.spacevim.d /init.vim. For example, use vim-one with Dark Colorscheme

let g:spacevim_colorscheme = 'one'
let g:spacevim_colorscheme_bg = 'dark'Copy the code

shortcuts describe
SPC T n Switch to the next random topic
SPC T s Choose a theme through Unite

You can view all the topics supported by SpaceVim in the topics module.

Note:

SpaceVim uses true colors in terminal by default, so you need to confirm whether your terminal supports true colors before using it. You can read Colours in terminal to know more information about true colors.

Interface element switching

Most interface elements can be hidden or shown by keyboard shortcuts (this group begins with t and T) :

shortcuts describe
SPC t 8 Highlight all characters over 80 columns
SPC t f Highlight the critical column, which defaults to column 80
SPC t h h Highlight the current line
SPC t h i Highlight code alignment lines
SPC t h c Highlight the column where the cursor is
SPC t h s Enable/disable syntax highlighting
SPC t i Toggle show current alignment (TODO)
SPC t n Show/hide the line number
SPC t b Toggle background color
SPC t t Open the Tab manager
SPC T ~ Shows/hides the blank line header at the end of buffer~
SPC T F Switch to full screen (TODO)
SPC T f Show/Hide Vim borders (GUI)
SPC T m Show/hide the menu bar
SPC T t Show/hide the toolbar

The status bar

The core#statusline module, which provides a highly customized status bar with the following features, is inspired by spacemacs’ status bar.

  • Display window serial number
  • Display the current mode in different colors
  • Show serial numbers of search results
  • Show/hide syntax check information
  • Display or hide battery information
  • Show/hide SpaceVim enabled status

Default theme gruvbox status bar color and mode comparison table:

model color
Normal gray
Insert blue
Visual orange
Replace Light green

The colors for each of the above modes depend on the theme mode.

Some status bar elements can be switched dynamically:

shortcuts describe
SPC t m b Show/hide battery status (ACPI required)
SPC t m c toggle the org task clock (available in org layer)(TODO)
SPC t m m Show/hide SpaceVim enabled
SPC t m M Show/hide file types
SPC t m n toggle the cat! (if colors layer is declared in your dotfile)(TODO)
SPC t m p Display or hide the mouse position
SPC t m t Show/hide time
SPC t m T Show/hide the status bar
SPC t m v Display/hide version control information

Powerline font installation:

SpaceVim uses DejaVu Sans Mono for Powerline by default, which you’ll need to install in order for the status bar to display properly. If you want to display other types of separators in the status bar, you need to install Powerline Extra Symbols.

Syntax check information:

Syntax check information element in the status bar If enabled, the current number of syntax errors and warnings is displayed in the status bar when the syntax check is complete.

TODO: add a picture

Syntax check information

Search result information:

When using/or? When searching, or when n or N is pressed, the serial number of the search results will be displayed in the status bar, similar to 20/22 showing the total number of search results and the serial number of the current results. Specific renderings are as follows:

search index in statusline

Battery status information:

Acpi displays the percentage of battery remaining.

Use different colors to display different battery states:

Battery status color
75% – 100%. green
30% – 75%. yellow
0-30% red

All colors depend on different themes.

Status bar separator:

You can customize the status bar separator by using G :spacevim_statusline_separator, for example using the very common direction arrow as the status bar separator:

let g:spacevim_statusline_separator = 'arrow'Copy the code

The segmentation supported by SpaceVim and screenshots are as follows:

separator screenshots
arrow
curve
slant
nil
fire

SpaceVim function module:

Function modules can be displayed or hidden by SPC T M shortcut keys. Unicode characters are used by default, and ASCII characters can be enabled by setting let g:spacevim_statusline_unicode_symbols = 0. (Perhaps you can use this option when a proper font cannot be set on the terminal.)

Whether to display the characters in the function module in the status bar is the same as the following shortcut keys:

shortcuts Unicode ASCII function
SPC t 8 today 8 Highlight the information after 80 columns
SPC t f f Highlight column 80
SPC t s s Syntax checking
SPC t S S Spell check
SPC t w w Line end space check
TAB bar

If there is only one Tab, Buffers will be listed in a Tab bar, each containing the serial number, file type icon, and file name. If there is more than one Tab, all tabs are listed in the Tab bar. Each Tab or Baffer on the Tab bar can be quickly accessed by using the shortcut key

number. The default

is \.

shortcuts describe
<Leader> 1 Skip to label bar number 1
<Leader> 2 Skip to label bar number 2
<Leader> 3 Skip to label bar number 3
<Leader> 4 Skip to label bar number 4
<Leader> 5 Skip to label bar number 5
<Leader> 6 Skip to label bar number 6
<Leader> 7 Skip to label bar number 7
<Leader> 8 Skip to label bar number 8
<Leader> 9 Skip to label bar number 9

Automatic completion

Shortcut keys in Unite/Denite buffer
shortcuts model Functional description
Ctrl+h/k/l/r Normal invalid
Ctrl+l Normal Refresh the interface
Tab Insert The next result
Tab Normal Select operation
Shift + Tab Insert In a result
Space Normal Mark current result
Enter Normal Perform default operations
Ctrl+v Normal Open in a split window
Ctrl+s Normal The vertical split window opens
Ctrl+t Normal Open it in a new Tab
Ctrl + g Normal Unite/Denite
jk Insert Leaving Insert mode
r Normal Rename or replace the search content
Ctrl+z Normal/insert Switch window layout
Ctrl+w Insert Delete the previous word

shortcuts
Browse shortcuts via Unite/Denite

Can be through SPC? Use Unite to list the current shortcuts. Unite can then blur the match and display the result by typing a keyboard shortcut letter or description.

Use the

key or up and down arrow keys to select the desired shortcut key, and press Enter will execute the shortcut key.

Get help information

Denite/Unite is a powerful information filtering browser, similar to Helm in Emacs. These shortcuts will help you quickly get the information you need:

shortcuts describe
SPC h SPC Use Unite to display the SpaceVim help document chapter catalog
SPC h i Get help information for the word under the cursor
SPC h k Navigate using shortcut keys to show the prefix keys supported by SpaceVim
SPC h m Use Unite to browse all MAN documents

Report a problem:

shortcuts describe
SPC h I Display the necessary information for the Issue based on the template
Available plug-ins

You can list all installed plug-ins through the shortcut key

L p, support fuzzy search, press enter will use the browser to open the official website of the plug-in.

Interface element display switch

All interface elements switch shortcuts start with [SPC] t or [SPC] t. You can view all shortcuts in the shortcut navigation.

The cursor

The cursor movement defaults to the default form of VI: HJKL.

shortcuts describe
h Move the cursor to the left (Vim native, no mapping)
j Move the cursor down (Vim native, no mapping)
k Move the cursor up (Vim native, no mapping)
l Move the cursor to the right (Vim native, no mapping)
H Cursor moves to the top of the screen (Vim native, no mapping)
L Cursor moves to the bottom of the screen (Vim native, no mapping)
SPC j 0 Jump to the top of the line (and mark the original position)
SPC j $ Jump to the end of the line (and mark the original position)
SPC t - Lock cursor in middle of screen (TODO)
Quick skip to url (TODO)

Similar to the f key in Firefox’s Vimperator.

shortcuts describe
SPC j u/ (o for help buffer) Quickly jump to/open the URL
Jump, merge, split

Shortcuts prefixed with SPC J are mainly used for jumping, joining, and splitting.

Merge, break up
shortcuts describe
J Merges the current row and the next row
SPC j k Skip to the next line and align the line
SPC j n Disconnects the current line from the cursor and inserts an empty line and aligns it
SPC j o Splits the line from the cursor, leaving the cursor on the current line
SPC j s Split String from cursor
SPC j S Split the String from the cursor and insert the aligned blank line
Common shortcut keys for window operation

Each window, there is a number, the number is displayed in the status bar at the front, through the SPC number for quick window jump.

shortcuts describe
SPC 1 Jump to window 1
SPC 2 Jump to window 2
SPC 3 Jump to window 3
SPC 4 Jump to window 4
SPC 5 Jump to window 5
SPC 6 Jump to window 6
SPC 7 Jump to window 7
SPC 8 Jump to window 8
SPC 9 Jump to window 9

Shortcut keys related to window operation (prefixed with SPC W) :

shortcuts describe
SPC w TAB/<Tab> Switch Windows within the unified TAB
SPC w = Align the separated Windows
SPC w b force the focus back to the minibuffer (TODO)
SPC w c Enter the reading mode and browse the current window
SPC w C Select a window and enter reading mode
SPC w d Delete a window
SPC u SPC w d delete a window and its current buffer (does not delete the file) (TODO)
SPC w D Select a window and close it
SPC u SPC w D delete another window and its current buffer using vim-choosewin (TODO)
SPC w t toggle window dedication (dedicated window cannot be reused by a mode) (TODO)
SPC w f toggle follow mode (TODO)
SPC w F Create a new TAB
SPC w h Move to the left window
SPC w H Move the window to the left
SPC w j Move to the lower window
SPC w J Move the window to the bottom
SPC w k Move to the upper window
SPC w K Move the window up
SPC w l Move to the right window
SPC w L Move the window to the right
SPC w m Maximize/minimize Windows (maximize is equivalent to closing other Windows) (TODO, now only support maximize)
SPC w M Select the window to replace
SPC w o Switch the tabs in sequence
SPC w p m open messages buffer in a popup window (TODO)
SPC w p p close the current sticky popup window (TODO)
SPC w r Switch Windows in sequence
SPC w R Switch Windows in reverse order
SPC w s or SPC w - Horizontal split window
SPC w S Split the window horizontally and switch to a new window
SPC w u undo window layout (used to effectively undo a closed window) (TODO)
SPC w U redo window layout (TODO)
SPC w v or SPC w / Vertical separation window
SPC w V Detach the window vertically and switch to a new window
SPC w w Switch to the previous window
SPC w W Select a window
Shortcut keys for Buffer operations

Buffer shortcuts are prefixed with SPC B:

shortcuts describe
SPC TAB Switch to the previous buffer, which can be used to switch between two buffers
SPC b . Enable buffer temporary shortcut key
SPC b b Switch to a buffer and filter through Unite/Denite
SPC b d Delete the current buffer, but keep the Vim window
SPC u SPC b d kill the current buffer and window (does not delete the visited file) (TODO)
SPC b D Select a window and delete its buffer
SPC u SPC b D kill a visible buffer and its window using ace-window(TODO)
SPC b C-d Delete other Buffers
SPC b C-D kill buffers using a regular expression(TODO)
SPC b e Clearing the current buffer requires manual confirmation
SPC b h Open theSpaceVimThe welcome screen
SPC b n Switch to the next buffer to exclude special plugins
SPC b m Open theMessages buffer
SPC u SPC b m kill all buffers and windows except the current one(TODO)
SPC b p Switch to the previous buffer to exclude special plugins
SPC b P Replace the current buffer with the clipboard contents
SPC b R Reread the file corresponding to the current buffer from disk
SPC b s switch to the scratch buffer (create it if needed) (TODO)
SPC b w Changing the Read-only Permission
SPC b Y Copy the entire buffer to the clipboard
z f Make current function or comments visible in buffer as much as possible (TODO)
Special buffer

In SpaceVim, there are many special buffers that are created by plug-ins or SpaceVim itself and are not listed.

Vim and SpaceVim related files

SpaceVim related shortcuts are prefixed with SPC F V, which facilitates quick access to SpaceVim configuration files:

shortcuts describe
SPC f v v Copy and display the current version of SpaceVim
SPC f v d Open the SpaceVim user profile
Common operations in a file tree

HJKL is the core of the file tree, which is similar to the shortcut keys commonly used in VIFM:

shortcuts describe
<F3> or SPC f t Switching file tree
Shortcut keys in the file tree
<Left> or h Move to the parent directory and close the folder
<Down> or j Move the cursor down
<Up> or k Move cursor up
<Right> or l Expand a directory or open a file
Ctrl+j Don’t use
Ctrl+l Don’t use
E Don’t use
. Toggle show hidden files
sv Edit the file in split screen
sg Edit the file in vertical split screen
p Preview the file
i Switch to folder history
v Quick look
gx Execute the file using the program (TODO)
' Switching between
V Mark the file
Ctrl+r Refresh the page

Commands starting with g

after pressing prefix g in normal mode, if you do not remember the mappings, you will see the guide which will tell you the functional of all mappings starting with g.

Key Binding Description
g# search under cursor backward
g$ go to rightmost character
g& repeat last “:s” on all lines
g' jump to mark
g* search under cursor forward
g+ newer text state
g, newer position in change list
g- older text state
g/ stay incsearch
g0 go to leftmost character
g; older position in change list
g< last page of previous command output
g<Home> go to leftmost character
gE end of previous word
gF edit file under cursor(jump to line after name)
gH select line mode
gI insert text in column 1
gJ join lines without space
gN visually select previous match
gQ switch to Ex mode
gR enter VREPLACE mode
gT previous tag page
gU make motion text uppercase
g] tselect cursor tag
g^ go to leftmost no-white character
g_ go to last char
g` jump to mark
ga print ascii value of cursor character
gd goto definition
ge go to end of previous word
gf edit file under cursor
gg go to line N
gh select mode
gi insert text after ‘^ mark
gj move cursor down screen line
gk move cursor up screen line
gm go to middle of screenline
gn visually select next match
go goto byte N in the buffer
gs sleep N seconds
gt next tag page
gu make motion text lowercase
g~ swap case for Nmove text
g<End> go to rightmost character
g<C-G> show cursor info

Auto-saving

With an external tool

SpaceVim can be interfaced with different searching tools like:

The search commands in SpaceVim are organized under the SPC s prefix with the next key is the tool to use and the last key is the scope. For instance SPC s a b will search in all opened buffers using ag.

If the last key (determining the scope) is uppercase then the current word under the cursor is used as default input for the search. For instance SPC s a B will search with word under cursor.

If the tool key is omitted then a default tool will be automatically selected for the search. This tool corresponds to the first tool found on the system of the list g:spacevim_search_tools, the default order is rg, ag, pt, ack then grep. For instance SPC s b will search in the opened buffers using pt if rg and ag have not been found on the system.

The tool keys are:

Tool Key
ag a
grep g
ack k
rg r
pt t

The available scopes and corresponding keys are:

Scope Key
opened buffers b
files in a given directory f
current project p

It is possible to search in the current file by double pressing the second key of the sequence, for instance SPC s a a will search in the current file with ag.

Notes:

  • rg.ag and pt are optimized to be used in a source control repository but they can be used in an arbitrary directory as well.
  • It is also possible to search in several directories at once by marking them in the unite buffer.

Beware if you use pt, TCL parser tools also install a command line tool called pt.

Useful key bindings
Key Binding Description
SPC r l resume the last completion buffer
SPC s ` go back to the previous place before jump
Prefix argument will ask for file extensions
Searching in all loaded buffers
Key Binding Description
SPC s b search with the first found tool
SPC s B search with the first found tool with default input
SPC s a b ag
SPC s a B ag with default input
SPC s g b grep
SPC s g B grep with default input
SPC s k b ack
SPC s k B ack with default input
SPC s r b rg
SPC s r B rg with default input
SPC s t b pt
SPC s t B pt with default input
Searching in a project
Key Binding Description
SPC / or SPC s p search with the first found tool
SPC * or SPC s P search with the first found tool with default input
SPC s a p ag
SPC s a P ag with default text
SPC s g p grep
SPC s g p grep with default text
SPC s k p ack
SPC s k P ack with default text
SPC s t p pt
SPC s t P pt with default text
SPC s r p rg
SPC s r P rg with default text

Hint: It is also possible to search in a project without needing to open a file beforehand. To do so use SPC p p and then C-s on a given project to directly search into it like with SPC s p. (TODO)

Searching the web
Key Binding Description
SPC s w g Get Google suggestions in vim. Opens Google results in Browser.
SPC s w w Get Wikipedia suggestions in vim. Opens Wikipedia page in Browser.(TODO)

Note: to enable google suggestions in vim, you need to add let g:spacevim_enable_googlesuggest = 1 to your custom Configuration file.

Persistent highlighting

SpaceVim uses g:spacevim_search_highlight_persist to keep the searched expression highlighted until the next search. It is also possible to clear the highlighting by pressing SPC s c or executing the ex command :noh.

Paste text

Text manipulation commands

Text related commands (start with x):

Key Binding Description
SPC x a & align region at &
SPC x a ( align region at (
SPC x a ) align region at )
SPC x a [ align region at [
SPC x a ] align region at ]
SPC x a { align region at {
SPC x a } align region at }
SPC x a , align region at ,
SPC x a . align region at . (for numeric tables)
SPC x a : align region at :
SPC x a ; align region at ;
SPC x a = align region at =
SPC x a ¦ The align region at ¦
SPC x a a align region (or guessed section) using default rules (TODO)
SPC x a c align current indentation region using default rules (TODO)
SPC x a l left-align with evil-lion (TODO)
SPC x a L right-align with evil-lion (TODO)
SPC x a r align region using user-specified regexp (TODO)
SPC x a m align region at arithmetic operators (+ - * /) (TODO)
SPC x c count the number of chars/words/lines in the selection region
SPC x d w delete trailing whitespaces
SPC x d SPC Delete all spaces and tabs around point, leaving one space
SPC x g l set lanuages used by translate commands (TODO)
SPC x g t translate current word using Google Translate
SPC x g T reverse source and target languages (TODO)
SPC x i c change symbol style to lowerCamelCase
SPC x i C change symbol style to UpperCamelCase
SPC x i i cycle symbol naming styles (i to keep cycling)
SPC x i - change symbol style to kebab-case
SPC x i k change symbol style to kebab-case
SPC x i _ change symbol style to under_score
SPC x i u change symbol style to under_score
SPC x i U change symbol style to UP_CASE
SPC x j c set the justification to center (TODO)
SPC x j f set the justification to full (TODO)
SPC x j l set the justification to left (TODO)
SPC x j n set the justification to none (TODO)
SPC x j r set the justification to right (TODO)
SPC x J move down a line of text (enter transient state)
SPC x K move up a line of text (enter transient state)
SPC x l d duplicate line or region (TODO)
SPC x l s sort lines (TODO)
SPC x l u uniquify lines (TODO)
SPC x o use avy to select a link in the frame and open it (TODO)
SPC x O use avy to select multiple links in the frame and open them (TODO)
SPC x t c swap (transpose) the current character with the previous one
SPC x t w swap (transpose) the current word with the previous one
SPC x t l swap (transpose) the current line with the previous one
SPC x u set the selected text to lower case (TODO)
SPC x U set the selected text to upper case (TODO)
SPC x w c count the number of occurrences per word in the select region (TODO)
SPC x w d show dictionary entry of word from wordnik.com (TODO)
SPC x TAB indent or dedent a region rigidly (TODO)

Commenting

Comments are handled by nerdcommenter, it’s bound to the following keys.

Key Binding Description
SPC ; comment operator
SPC c h hide/show comments
SPC c l comment lines
SPC c L invert comment lines
SPC c p comment paragraphs
SPC c P invert comment paragraphs
SPC c t comment to line
SPC c T invert comment to line
SPC c y comment and yank
SPC c Y invert comment and yank

Tips: To comment efficiently a block of line use the combo SPC ; SPC j l

dev

Multi-Encodings

SpaceVim use utf-8 as default encoding. there are four options for these case:

  • fileencodings (fencs): ucs-bom,utf-8,default,latin1
  • fileencoding (fenc): utf-8
  • encoding (enc): utf-8
  • termencoding (tenc): utf-8 (only supported in vim)

to fix messy display: SPC e a is the mapping for auto detect the file encoding. after detecting file encoding, you can run the command below to fix the encoding:

set enc=utf-8
writeCopy the code

Managing projects

Projects in SpaceVim are managed by vim-projectionist and vim-rooter, vim-rooter will find the root of the project when a .git directory or a .projections.json file is encountered in the file tree.

project manager commands start with p:

Key Binding Description
SPC p ' Open a shell in project’s root (with the shell layer)

issues

Achievements Account
100th issue(issue) BenBergman

Stars, forks and watchers

Achievements Account
First stargazers monkeydterry
100th stargazers naraj
1000th stargazers icecity96
2000th stargazers frowhy
3000th stargazers purkylin

Features

Mnemonic key bindings

Key Bindings are organized using mnemonic prefixes like B for buffer, P for project, S for search, H for help, etc…

SPC mapping root : SPC means <Space> on the keyboard.

Key Description
SPC ! shell cmd
SPC a +applications
SPC b +buffers
SPC 1... 9 windows 1… 9

Key Mapping

Embed. Coggle. It/diagram/WMl…

c/c++ support

  1. code completion: autocompletion and fuzzy match.
  2. syntax check: Asynchronous linting and make framework.

go support

  1. code completion:
  2. syntax check:

python support

  1. code completion:
  2. syntax check:

Neovim centric – Dark powered mode of SpaceVim.

By default, SpaceVim use these dark powered plugins:

  1. deoplete.nvim – Dark powered asynchronous completion framework for neovim
  2. dein.vim – Dark powered Vim/Neovim plugin manager

TODO:

  1. defx.nvim – Dark powered file explorer
  2. deoppet.nvim – Dark powered snippet plugin
  3. denite.nvim – Dark powered asynchronous unite all interfaces for Neovim/Vim8

Modular configuration

Global origin vim leader

Vim’s origin global leader can be used in all modes.

Windows function leader

Windows function leader can only be used in normal mode. For the list of mappings see the link

Unite work flow leader

Unite work flow leader can only be used in normal mode. Unite leader need unite groups.

Plugin Highlights

  • Package management with caching enabled and lazy loading

  • Project-aware tabs and label

  • Vimfiler as file-manager + SSH connections

  • Go completion via vim-go and gocode

  • Javascript completion via Tern

  • PHP completion, indent, folds, syntax

  • Python jedi completion, pep8 convention

  • Languages: Ansible, css3, csv, json, less, markdown, mustache

  • Helpers: Undo tree, bookmarks, git, tmux navigation, hex editor, sessions, and much more.

    Note that 90% of the plugins are [lazy-loaded].

    [lazy-loaded]: ./config/plugins.vim

Lazy-Loaded Plugins

Commands
Name Description
vimfiler Powerful file explorer
[NERD Commenter] Comment tool – no comment necessary
vinarise Hex editor
syntastic Syntax checking hacks
gita An awesome git handling plugin
gista Manipulate gists in Vim
undotree Ultimate undo history visualizer
incsearch Improved incremental searching
expand-region Visually select increasingly larger regions of text
open-browser Open URI with your favorite browser
prettyprint Pretty-print vim variables
quickrun Run commands quickly
ref Integrated reference viewer
dictionary Dictionary.app interface
vimwiki Personal Wiki for Vim
thesaurus Look up words in an online thesaurus
Commands
Name Description
goyo Distraction-free writing
limelight Hyperfocus-writing
matchit Intelligent pair matching
indentline Display vertical indention lines
choosewin Choose window to use, like tmux’s ‘display-pane’
Completion
Name Description
delimitmate Insert mode auto-completion for quotes, parenthesis, brackets
echodoc Print objects’ documentation in echo area
deoplete Neovim: Dark powered asynchronous completion framework
neocomplete Next generation completion framework
neosnippet Contains neocomplete snippets source
Unite
Name Description
unite Unite and create user interfaces
unite-colorscheme Browse colorschemes
unite-filetype Select file type
unite-history Browse history of command/search
unite-build Build with Unite interface
unite-outline File “outline” source for unite
unite-tag Tags source for Unite
unite-quickfix Quickfix source for Unite
neossh SSH interface for plugins
unite-pull-request GitHub pull-request source for Unite
junkfile Create temporary files for memo and testing
unite-issue Issue manager for JIRA and GitHub
Operators & Text Objects
Name Description
operator-user Define your own operator easily
operator-replace Operator to replace text with register content
operator-surround Operator to enclose text objects
textobj-user Create your own text objects
textobj-multiblock Handle multiple brackets objects

Custom Key bindings

Key Mode Action
<leader>+y visual Copy selection to X11 clipboard (“+y)
Ctrl+c Normal Copy full path of current buffer to X11 clipboard
<leader>+Ctrl+c Normal Copy github.com url of current buffer to X11 clipboard(if it is a github repo)
<leader>+Ctrl+l Normal/visual Copy github.com url of current lines to X11 clipboard(if it is a github repo)
<leader>+p Normal/visual Paste selection from X11 clipboard (“+p)
Ctrl+f Normal Smart page forward (C-f/C-d)
Ctrl+b Normal Smart page backwards (C-b/C-u)
Ctrl+e Normal Smart scroll down (3C-e/j)
Ctrl+y Normal Smart scroll up (3C-y/k)
Ctrl+q Normal Ctrl+w
Ctrl+x Normal Switch buffer and placement
Up,Down Normal Smart up and down
} Normal After paragraph motion go to first non-blank char (}^)
< Visual/Normal Indent to left and re-select
> Visual/Normal Indent to right and re-select
Tab Visual Indent to right and re-select
Shift+Tab Visual Indent to left and re-select
gp Normal Select last paste
Q/gQ Normal Disable EX-mode ()
Ctrl+a Command Navigation in command line
Ctrl+b Command Move cursor backward in command line
Ctrl+f Command Move cursor forward in command line
Editor UI
Key Mode Action
F2 All Toggle tagbar
F3 All Toggle Vimfiler
<leader> + num Normal Jump to the buffer whit the num index
<Alt> + num Normal Jump to the buffer whit the num index, this only works in neovim
<Alt> + h/<Left> Normal Jump to left buffer in the tabline, this only works in neovim
<Alt> + l/<Right> Normal Jump to Right buffer in the tabline, this only works in neovim
<leader>+ts Normal Toggle spell-checker (:setlocal spell!)
<leader>+tn Normal Toggle line numbers (:setlocal nonumber!)
<leader>+tl Normal Toggle hidden characters (:setlocal nolist!)
<leader>+th Normal Toggle highlighted search (:set hlsearch!)
<leader>+tw Normal Toggle wrap (:setlocal wrap! breakindent!)
g0 Normal Go to first tab (:tabfirst)
g$ Normal Go to last tab (:tablast)
gr Normal Go to previous tab (:tabprevious)
Ctrl+<Dow> Normal Move to split below (j)
Ctrl+<Up> Normal Move to upper split (k)
Ctrl+<Left> Normal Move to left split (h)
Ctrl+<Right> Normal Move to right split (l)
* Visual Search selection forwards
# Visual Search selection backwards
.+Space Normal Remove all spaces at EOL
Ctrl+r Visual Replace selection
<leader>+lj Normal Next on location list
<leader>+lk Normal Previous on location list
<leader>+S Normal/visual Source selection
Native functions
Key Mode Action
<leader> + qr Normal Same as native q
<leader> + qr/ Normal Same as native q/, open cmdwin
<leader> + qr? Normal Same as native q?, open cmdwin
<leader> + qr: Normal Same as native q:, open cmdwin
Plugin: neocomplete
Key Mode Action
Enter Insert Smart snippet expansion
Ctrl+space Insert Autocomplete with Unite
Tab Insert/select Smart tab movement or completion
Ctrl+j/k/f/b Insert Movement in popup
Ctrl+g Insert Undo completion
Ctrl+l Insert Complete common string
Ctrl+o Insert Expand snippet
Ctrl+y Insert Close pop-up
Ctrl+e Insert Close pop-up
Ctrl+l Insert Complete common string
Ctrl+d Insert Scroll down
Ctrl+u Insert Scroll up
Plugin: Goyo and Limelight
Key Mode Action
<leader>+G Normal Toggle distraction-free writing
Plugin: Bookmarks
Key Mode Action
m+a Normal Show list of all bookmarks
m+m Normal Toggle bookmark in current line
m+n Normal Jump to next bookmark
m+p Normal Jump to previous bookmark
m+i Normal Annotate bookmark

As SpaceVim use above bookmarks mappings, so you can not use a, m, n, p or i registers to mark current position, but other registers should works will. if you really need to use these registers, you can add nnoremap <leader>m m to your custom configuration, then you use use a registers via \ma

Plugin: vim-signify
Key Mode Action
<leader>+hj / ]c Normal Jump to next hunk
<leader>+hk / [c Normal Jump to previous hunk
<leader>+hJ / ]C Normal Jump to last hunk
<leader>+hK / [C Normal Jump to first hunk

Modular configuration

SpaceVim is a configuration set composed of multiple independent modules designed for different functional requirements, and users only need to load the corresponding modules when using them. For Java developers, load lang# Java, autocomplete, checker, tags modules to configure a Vim environment suitable for Java development.

Modules supported by SpaceVim: spacevim.org/layers/

Automatic completion

SpaceVim uses deoplete, the fastest completion engine, which differs from YouCompleteMe in that it supports multi-source completion, not just semantic completion. And complete the source expansion is very convenient.

fast

SpaceVim will load the configuration from ~/.spacevim.d /init.vim and the./ spacevim.d /init.vim of the current directory, and update the RTP, Users can edit their own scripts and SpaceVim configuration files in the ~/.spacevim.d/and.spacevim.d/folders.

Example:

" Here are some basic customizations,
" please refer to the ~/.SpaceVim.d/init.vim
" file for all possible options:
let g:spacevim_default_indent = 3
let g:spacevim_max_column     = 80

" Change the default directory where all miscellaneous persistent files go.
" By default it is ~/.cache/vimfiles/.
let g:spacevim_plugin_bundle_dir = '~/.cache/vimfiles/'

" set SpaceVim colorscheme
let g:spacevim_colorscheme = 'jellybeans'

" Set plugin manager, you want to use, default is dein.vim
let g:spacevim_plugin_manager = 'dein'  " neobundle or dein or vim-plug

" use space as `<Leader>`
let mapleader = "\<space>"

" Set windows shortcut leader [Window], default is `s`
let g:spacevim_windows_leader = 's'

" Set unite work flow shortcut leader [Unite], default is `f`
let g:spacevim_unite_leader = 'f'

" By default, language specific plugins are not loaded. This can be changed
" with the following, then the plugins for go development will be loaded.
call SpaceVim#layers#load('lang#go')

" loaded ui layer
call SpaceVim#layers#load('ui')

" If there is a particular plugin you don't like, you can define this
" variable to disable them entirely:
let g:spacevim_disabled_plugins=[
    \ ['junegunn/fzf.vim'].\ ]

" If you want to add some custom plugins, use these options:
let g:spacevim_custom_plugins = [
    \ ['plasticboy/vim-markdown', {'on_ft' : 'markdown'}].\ ['wsdjeg/GitHub.vim'].\ ]

" set the guifont
let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11'Copy the code

read