I'm wondering which vim options should I be specifying in modelines in my source files (mostly C), and which should not be specified there and rather left for the user to specify.
I believe that the modelines should enforce code-specific policies and/or help vim with the code, while avoiding interfering with user preferences if possible.
When answering, please explain why you believe that a particular option should be enforced via modeline, or not.
Right now, I find the following options useful:
ft
to ensure that vim recognizes the file format correctly,noet
andsts=0
to disable expanding tabs into spaces (project coding style),et
,ts
,sts
andsw
to enforce project-specific tab expansion,tw
to suggest line wrapping (but I wouldn't be so sure about that as it is a bit intrusive),fenc
to indicate the character encoding.And those are the options I believe I shouldn't be setting:
ts
if the project uses tab-indent — I believe that the user should be able to choose his own tab width,ff
because vim should deduce the newline format correctly and if some software (like VCS) transparently converts the file,ff
will actually break it.