a-dekker / vim-qmlfmt

Vim plugin for qmlfmt (https://github.com/jesperhh/qmlfmt)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vim plugin for qmlfmt

Based on vim-shfmt

The Vim qmlfmt plugin runs qmlfmt to auto format the current buffer

Requirements

You just need the qmlfmt command

Installation

Obtain a copy of this plugin and place qmlfmt.vim in your Vim plugin directory or be sensible and use something like Plug:

Plug 'a-dekker/vim-qmlfmt', { 'for': 'qml' }

or via vundle:

" qml formatter
Plugin 'a-dekker/vim-qmlfmt'

Usage

You can use the :Qmlfmt command to run qmlfmt and automatically format the current buffer

You can also use the :Qmlfmt command together with options. For example,

:Qmlfmt -t 4
:Qmlfmt -i 2

Configuration

qmlfmt uses 4 spaces by default for auto formatting, so if you prefer to use 2 spaces, you can set the following in your .vimrc file:

let g:qmlfmt_extra_args = '-i 2'

Auto format on save

If you would like to auto format shell scripts on save, you can add the following to your vim config:

let g:qmlfmt_fmt_on_save = 1

License

The Vim qmlfmt plugin is open-sourced software licensed under the MIT license.

About

Vim plugin for qmlfmt (https://github.com/jesperhh/qmlfmt)

License:MIT License


Languages

Language:Vim Script 100.0%