You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Load the plugin how you like (I use pathogen still), then:
let g:ansible_unindent_after_newline = 1
let g:ansible_attribute_highlight = "ob"
let g:ansible_extra_keywords_highlight = 1
let g:ansible_normal_keywords_highlight = 'Constant'
let g:ansible_with_keywords_highlight = 'Constant'
let g:ansible_template_syntaxes = { '*.rb.j2': 'ruby' }
Create a new tasks/main.yml and start making some magic, only to find it breaking in the most frustrating ways.
---
- name: This is just a demo
hosts: "{{ target|default('localhost') }}"
tasks:
- name: Show the brokenness.
## Prevent fail-into
when: (ansible_facts['distribution'] == "bananabread")
template:
src: some.j2
dest: /usr/local/etc/some.conf
- name: This line did not indent even close to correctly.
# vim:ft=yaml.ansible:
But we have let g:ansible_unindent_after_newline = 1 so this should fix it, right? Wrong.
---
- name: This is just a demo
hosts: "{{ target|default('localhost') }}"
tasks:
- name: Show the brokenness.
## Prevent fail-into
when: (ansible_facts['distribution'] == "bananabread")
template:
src: some.j2
dest: /usr/local/etc/some.conf
- name: Well this line has no business being all the way over here.
# vim:ft=yaml.ansible:
More obnoxiously, this is unfixable without killing the plugin. Fix the broken indent, assuming it will reset position, and it does not. Instead it re-indents the whole thing back to 0 and just keeps breaking it over and over.
The text was updated successfully, but these errors were encountered:
pearofducks
changed the title
ansible_unindent_after_newline unindenting too aggressively
Improve ansible_unindent_after_newline to intelligently un-indent to the correct parent block
Jun 30, 2019
Would it be possible to simply implement an option to disable the indention from this plugin? I find the standard yaml indention logic to be enough but it would still be nice to have the highlighting from this plugin while not having to work around the indention.
This one is really frustrating me.
Load the plugin how you like (I use pathogen still), then:
Create a new
tasks/main.yml
and start making some magic, only to find it breaking in the most frustrating ways.But we have
let g:ansible_unindent_after_newline = 1
so this should fix it, right? Wrong.More obnoxiously, this is unfixable without killing the plugin. Fix the broken indent, assuming it will reset position, and it does not. Instead it re-indents the whole thing back to 0 and just keeps breaking it over and over.
The text was updated successfully, but these errors were encountered: