I am thinking on a similar solution, which Eclipse also does: during the editing, the editor tries to always hold in a well-indented format of the edited textual data.Ideally, it would happen very strong: the best were if anything breaking the well-formatting would be corrected on the spot.Is it somehow possible?
How to make auto-indent XML in vim?
indentation;markup;filetype xml
I commented out my entire .vimrc file, then added a few indentation related things. Using the process of elimination, I landed on the following line being solely responsible getting my XML indentation to work:filetype plugin indent onHowever, this only worked when loaded from the .vimrc file. Manually typing it in had no effect for me.According to :h filetype-indent-on:You can enable loading the indent file for specific file types with:         :filetype indent onIf filetype detection was not switched on yet, it will be as well.  This actually loads the file indent.vim in 'runtimepath'.  The result is that when a file is edited its indent file is loaded (if there  is one for the detected filetype). |indent-expression|If you have filetype indent on enabled in your .vimrc and don't have indentation, you're probably missing the indentation definition file.