Closed lydell closed 7 years ago
A hack (IMO) is to put let g:did_indent_on = 0
after filetype indent off
(because filetype indent off
unlet
s that variable) in your .vimrc. That causes vim-sleuth not to run filetype indent on
. However, I'm not sure what side effects this hack may have, considering that the variable is only supposed to exist when filetype indent on
is used. (As an attempt to reduce such side effects, I at least set the variable to a falsy value. Perhaps that helps, perhaps it makes things worse.)
So there is a hacky solution. But I'm still curious why vim-sleuth has this behavior which is seemingly unneeded and unrelated to the plugin's functionality. :)
I am also having troubles with this where commit b6347df73719dea0fb14695eae4d3506ebc4a36c has broken compatibility with vim-python-pep8-indent because sleuth is restoring the options that vim-python-pep8-indent sets when turning filetype indent back on.
@lydell :filetype indent on
enables the wealth of language specific indent plugins that live in the indent
subdirectories that live in the runtime path. A few of those set options like 'shiftwidth'
but mostly they just set 'indentexpr'
. It's possible you want to disable them, I guess, in the same way you might want to disable syntax highlighting, but I think it's a weird edge case, and let g:did_indent_on = 0
is probably good enough, unless someone can point out a problem with it.
@AWhetter if I understand your assertion correctly, I think overriding those settings in vim-python-pep8-indent should usually be beneficial. I would expect it to handle pep8 confirming files the same, but make the appropriate adjustments for files that march to the beat of their own drum. Are you running into a specific problem?
Running :filetype indent on
after sleuth is causing vim-python-pep8-indent
to set tabstop
, shiftwidth
, and expandtab
after sleuth does. Really I want :filetype indent on
to run before sleuth so that I still get the indent plugin goodness, but with sleuth overriding the indent settings specific to the file.
Maybe an option to run :filetype indent on
before or after sleuth would make sense. Giving you the option to have sleuth yield to an indent plugin, or have sleuth override an indent plugin.
Oh, right, now I remember the purpose of moving it.
You can work around on your end by just calling filetype indent on
in your vimrc. That's just as good as an option best I can tell. I'll mull over whether we should go back to the earlier default.
I’ve been running vim-sleuth with this patch all day:
It has detected the indentatition of all files I’ve worked with perfectly.
I want
:filetype indent off
.Here are three alternate suggestions:
:filetype indent on
enforcement.g:sleuth_enforce_filetype_indent_on
.Thanks for the best indentation detector I’ve come across so far!