Closed sean-abbott closed 7 years ago
Fair point, try this branch: https://github.com/pearofducks/ansible-vim/tree/newline-indent
Note: I try not to break current experiences, so if this gets merged it will probably be enabled via a flag.
If I put two newlines between the end of a block and the beginning of a new one, it doesn't happen. Still happens with only one newline.
Thanks!
(If it matters, ubuntu 16.04 vim: VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48) Included patches: 1-1689 Extra patches: 8.0.0056 )
To clarify...
This (with a spare newline there) works, where 'works' is "resets indentation":
- name: "ensure staged init file is populated"
become: yes
template:
src: "_etc_init.d_staged_service.j2"
dest: "/etc/init.d/{{ staged_service }}"
owner: "root"
group: "root"
mode: "0755"
- name: "this shouldn't be indented"
right?
It does not, actually:
https://asciinema.org/a/bi5yk7p5u2lfjfpsh3n8340m8
I mean, it's possible that I just need a better typing workflow, but ideally, if I hit enter twice, it would reset indentation without needing to exit insert mode.
Good enough be not forcing indentation if I exit insert mode and re-enter it (as I did in the video, but it still forced indentation).
Sorry if I'm being a pain. I double checked the auto-detection to make sure that it should be picked up as an ansible file, and I doublechecked when I edited it's picked up as an ansible file. Both are true.
Thanks!
No trouble at all, I agree with the use-case.
Somehow git and I disagreed. Update the newline-indent
branch and things should work now. :)
OMG that's heaven. Thank you so much!
This will be merged to master
soon, and already here is controlled via flag to enable:
let g:ansible_unindent_after_newline = 1
When I'm trying to start a new module after I've finished one, this plugin always indents to the level of the previous module's keys. i.e.:
This is super frustrating.
Thanks for the great plugin! I really generally love it!