I am looking into indenting for Ansible's YAML, e.g.:
---
- hosts: webservers
vars:
http_port: 80
max_clients: 200
remote_user: root
tasks:
- name: ensure apache is at the latest version
yum: pkg=httpd state=latest
- name: write the apache config file
template: src=/srv/httpd.j2 dest=/etc/httpd.conf
notify:
- restart apache
- name: ensure apache is running (and enable it at boot)
service: name=httpd state=started enabled=yes
handlers:
- name: restart apache
service: name=httpd state=restarted
(from http://docs.ansible.com/playbooks_intro.html)
With your plugin this gets indented as (using gg=G):
---
- hosts: webservers
vars:
http_port: 80
max_clients: 200
remote_user: root
tasks:
- name: ensure apache is at the latest version
yum: pkg=httpd state=latest
- name: write the apache config file
template: src=/srv/httpd.j2 dest=/etc/httpd.conf
notify:
- restart apache
- name: ensure apache is running (and enable it at boot)
service: name=httpd state=started enabled=yes
handlers:
- name: restart apache
service: name=httpd state=restarted
According to http://www.yamllint.com/ it is valid.
I have tried to improve another plugin, specifically targeted at Ansible, before (chase/vim-ansible-yaml#36), but it looks like your approach might be better (using the context).
Apart from that you have tests.. :)
I am looking into indenting for Ansible's YAML, e.g.:
(from http://docs.ansible.com/playbooks_intro.html)
With your plugin this gets indented as (using
gg=G):According to http://www.yamllint.com/ it is valid.
I have tried to improve another plugin, specifically targeted at Ansible, before (chase/vim-ansible-yaml#36), but it looks like your approach might be better (using the context).
Apart from that you have tests.. :)