SpaceVim

A community-driven vim distribution


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


Available Layers » format

Description

format layer provides code formatting feature for SpaceVim, this layer includes neoformat as the default code formatting plugin.

Install

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

[[layers]]
  name = "format"
  enable = false

Configuration

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 to add a formater 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, Help improve this page