A modular Vim/Neovim configuration

Home | About | Quick start guide | Documentation | Development | Community | Sponsors | 中文

Available Layers » format


The format layer provides code formatting for SpaceVim, with support for neoformat (default) and codefmt underlying code formatting plugins.


This layer is enabled by default. If you want to disable it, add the following to your configuration file:

  name = "format"
  enable = false


Layer options

Global options

neoformat is a formatting framework, all of it’s options can be used in bootstrap function. You can read :help neoformat for more info.

Here is an example for add formatter for java file, and it has been included into lang#java layer:

let g:neoformat_enabled_java = ['googlefmt']
let g:neoformat_java_googlefmt = {
    \ 'exe': 'java',
    \ 'args': ['-jar', '~/Downloads/google-java-format-1.5-all-deps.jar', '-'],
    \ 'stdin': 1,
    \ }

Key bindings

Key binding Description
SPC b f format whole buffer or selected lines

Powered by Jekyll