Cannot turn off autoindent/smartindent on xml or ant filetypes
byron-hawkins opened this issue · comments
Steps to reproduce
In a buffer with filetype set to "ant" or "xml";
:set noautoindent
:set nosmartindent
Now type something with an open brace ('{'), and vim indents the line. Closing the braced expression does not cause vim to un-indent the line. Typing tags, both open and closed, causes strange indentation that is incoherent with the xml structcure.
Expected behaviour
No lines should ever be indented by vim while I am typing in the buffer.
Version of Vim
VIM - Vi IMproved 9.0 (2022 Jun 28, compilé Nov 16 2023 00:00:00) Rustines incluses : 1-2105
Environment
Fedora 38 on a plain gnome terminal.
Logs and stack traces
No response
That's because for xml
files, indentexpr
is set, see indent/xml.vim. And ant
filetypes load the xml
indent script.
You need to set indentexpr=
(i.e. to an empty string) in ~/.vim/after/ftplugin/xml.vim
.
or remove indent
from filetype plugin indent on
not a bug, so closing