vint
vint copied to clipboard
Feature request: warn to use <nomodeline> with User autocmds
As recommended by the :h <nomodeline> docs:
After applying the autocommands the modelines are
processed, so that their settings overrule the
settings from autocommands, like what happens when
editing a file. This is skipped when the <nomodeline>
argument is present. You probably want to use
<nomodeline> for events that are not used when loading
a buffer, such as |User|.
Thanks, @lencioni .
I don't know what events that we should warn when the autocmd has no <nomodeline>.
Would you list the events?
Ah, I was thinking it would be nice to warn when it wasn't there for User events. Something like this:
silent doautocmd User MyUserCmd
should be:
silent doautocmd <nomodeline> User MyUserCmd
This was only added in Vim 7.3.438 so maybe that should be part of the message so that it can be made conditional?
if v:version > 703 || v:version == 703 && has('patch438')
silent doautocmd <nomodeline> User MyUserCmd
else
silent doautocmd User MyUserCmd
endif
OK, I agree this policy.
I'm gonna implement it later.