Python package pyyaml
need to be installed.
pip install pyyaml
Using Vundle:
Plugin 'tarekbecker/vim-yaml-formatter'
Execute YAMLFormat
to format the current buffer
:YAMLFormat
A range formatting is not supported.
VIM's configuration tabstop
determines the number of spaces used for
indention.
Per default collection items have the same indention level as their parent:
name:
- item
- item
yaml_formatter_indent_collection=1
can be used to indent the items:
name:
- item
- item
let g:yaml_formatter_indent_collection=1