On Di, 07 Okt 2014, Martin Tournoij wrote:

> ftplugin/python.vim and indent/sass.vim (and perhaps others...) reset some
> settings from my vimrc
> 
> My ~/.vimrc has:
>     set noexpandtab
>     set tabstop=4
>     set shiftwidth=4
>     set softtabstop=4
> 
> ftplugin/python.vim does:
>     setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8
> 
> and indent/sass.vim does:
>     setlocal autoindent sw=2 et
> 
> 
> This is rather annoying IMHO, I don't want to start a tabs vs. spaces
> discussion, but I almost exclusively use tab indentation with a ts/sts/sw of 
> 4.
> Having this suddenly reset in spite of my ~/.vimrc settings is quite 
> unexpected.
> 
> I know I can re-reset these settings with aug, which is what I'm doing now,
> but I really don't want to set the same default settings for lots of 
> filetypes,
> and it's even more annoying on "foreign" machines where I can now quickly 
> write
> a basic vimrc, and have most things work.
> 
> I don't know if this is a general trend, or that there are just two files that
> do this, a quick grep seems to indicate that these files are the exception,
> rather than the rule. I propose to either:
> a) Never overwrite settings set if set in vimrc
> b) Don't set these settings
> 
> a) would obviously be better, but seems difficult[1]. If someone knows a 
> better
> way than this StackOverflow answer, I'll be happy to write a patch for that,
> though. If not, I propose b) and don't set these options (unless perhaps it's
> absolutely required by a filetype, which it's not for Python & SASS).
> 
> The reason for a fairly lengthy mail for such a comparatively minor issue that
> is took me well over half a hour (plus frustration) writing SASS files a month
> ago, and now it's taken me more than that to figure out where this Python
> setting came from (plus frustration over the last week)... This is one of the
> few times Vim actually got in my way, rather than being helpful.

If you want your own settings and never want to have filetype plugins 
enabled, do NOT set the :filetype plugin command in your .vimrc (so 
ftplugins are effectively disabled). Alternatively you can override 
those settings for specific filetypes by creating your own 
after/ftplugin.vim files.

See also the faq:
http://vimhelp.appspot.com/vim_faq.txt.html#faq-26.6

Best,
Christian
-- 
Hauptsache, man hat zwei gesunde Füße, um der Arbeit aus dem Weg gehen
zu können.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui