Message from discussion
Global configuration in after directory possible?
Received: by 10.180.105.41 with SMTP id gj9mr3111734wib.3.1350674453886;
Fri, 19 Oct 2012 12:20:53 -0700 (PDT)
X-BeenThere: vim_use@googlegroups.com
Received: by 10.180.77.14 with SMTP id o14ls4219865wiw.2.gmail; Fri, 19 Oct
2012 12:20:05 -0700 (PDT)
Received: by 10.180.87.100 with SMTP id w4mr947109wiz.3.1350674405874;
Fri, 19 Oct 2012 12:20:05 -0700 (PDT)
Received: by 10.180.87.100 with SMTP id w4mr947108wiz.3.1350674405861;
Fri, 19 Oct 2012 12:20:05 -0700 (PDT)
Return-Path: <antoine.mechely...@gmail.com>
Received: from mailrelay006.isp.belgacom.be (mailrelay006.isp.belgacom.be. [195.238.6.172])
by gmr-mx.google.com with ESMTP id bu8si267519wib.2.2012.10.19.12.20.05;
Fri, 19 Oct 2012 12:20:05 -0700 (PDT)
Received-SPF: neutral (google.com: 195.238.6.172 is neither permitted nor denied by domain of antoine.mechely...@gmail.com) client-ip=195.238.6.172;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 195.238.6.172 is neither permitted nor denied by domain of antoine.mechely...@gmail.com) smtp.mail=antoine.mechely...@gmail.com
X-Belgacom-Dynamic: yes
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AkIpANSmgVBtgPni/2dsb2JhbABFgkSGHqYnji+GZAEBBTgkHRALCw0JJQ8CEjQTAQcCh20BFql4iAgKGYENiHuPJoMjA5VvkDiCcQ
Received: from 226.249-128-109.adsl-dyn.isp.belgacom.be (HELO [109.128.249.226]) ([109.128.249.226])
by relay.skynet.be with ESMTP; 19 Oct 2012 21:20:05 +0200
Message-ID: <5081A7E5.10504@gmail.com>
Date: Fri, 19 Oct 2012 21:20:05 +0200
From: Tony Mechelynck <antoine.mechely...@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/19.0 Firefox/19.0 SeaMonkey/2.16a1
MIME-Version: 1.0
To: vim_use@googlegroups.com
CC: Charles Campbell <Charles.E.Campb...@nasa.gov>
Subject: Re: Global configuration in after directory possible?
References: <fc8e524f-89f9-4b5c-8008-22c2ae206db6@googlegroups.com> <5081A16B.60103@nasa.gov>
In-Reply-To: <5081A16B.60103@nasa.gov>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
On 19/10/12 20:52, Charles Campbell wrote:
> lessthanideal wrote:
>> A lot of ftplugin files turn comment-wrapping on with a
>> command like this:
>>
>> set formatoptions+=c
>>
>> I want to globally disable it. Is there an easy way to do
>> this? I know I can disable it for particular filetypes by
>> creating files in vimfiles\after\ftplugin\ specifying "set
>> formatoptions-=c" but there are a lot of them.
>>
>> Two methods I've found from searching are
>>
>> . Maintain a single file and use symbolic links to make vim
>> access it for each filetype. A bit clumsy - new filetypes
>> might appear later, I want to maintain real
>> filetype-specific files as well, etc.
>>
>> . Use autocmd events to set this. This works in many cases
>> but different edge cases are missed by different events so
>> I'm not sure which events to use. Also it seems to be
>> "fighting vim" - trying to keep checking in case vim has
>> changed the setting and change it back. I'd like it to just
>> work, reliably.
>>
>> Is there a simpler method?
>>
> Have you tried putting formatoptions-=c in a file in .vim/after/plugin ?
>
> Regards,
> C Campbell
>
.vim/after/plugin/*.vim are sourced once, near the end of startup. The
problematic setting is set by $VIMRUNTIME/ftplugin/<whatever>.vim which
is sourced (again, if necessary) shortly after a file of <whatever>
filetype is opened for editing. So I think the chronology would be wrong
if just using "set fo-=c" in a global plugin. Unless _all_
filetype-plugins build on the default 'formatoptions' ("tcq" in
'incompatible' mode), only adding to or subtracting from it but not
replacing the whole option value.
Best regards,
Tony.
--
If you think the United States has stood still, who built the largest
shopping center in the world?
-- Richard Nixon