From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19826 invoked by alias); 19 Sep 2014 04:17:17 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 19817 invoked by uid 89); 19 Sep 2014 04:17:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mailout2.w1.samsung.com Received: from mailout2.w1.samsung.com (HELO mailout2.w1.samsung.com) (210.118.77.12) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (DES-CBC3-SHA encrypted) ESMTPS; Fri, 19 Sep 2014 04:17:14 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NC400GBZS18NA50@mailout2.w1.samsung.com> for gcc-patches@gcc.gnu.org; Fri, 19 Sep 2014 05:19:56 +0100 (BST) Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 23.FF.15956.14EAB145; Fri, 19 Sep 2014 05:17:05 +0100 (BST) Received: from [106.109.9.145] by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NC400EMFRWG8Q80@eusync3.samsung.com>; Fri, 19 Sep 2014 05:17:05 +0100 (BST) Message-id: <541BAE58.4050600@samsung.com> Date: Fri, 19 Sep 2014 04:17:00 -0000 From: Yury Gribov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-version: 1.0 To: Segher Boessenkool Cc: GCC Patches , Laurynas Biveinis , Jeff Law , Richard Biener , Bernhard Reutner-Fischer , Trevor Saunders , Mike Stump Subject: Re: [PATCHv4] Vimrc config with GNU formatting References: <540863C1.4000909@samsung.com> <54100735.5040700@samsung.com> <541867A2.6020405@samsung.com> <5419C01C.2040404@samsung.com> <20140918035233.GB24532@gate.crashing.org> <541A9A68.7050000@samsung.com> <20140918172003.GA28595@gate.crashing.org> In-reply-to: <20140918172003.GA28595@gate.crashing.org> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg01587.txt.bz2 On 09/18/2014 09:20 PM, Segher Boessenkool wrote: > On Thu, Sep 18, 2014 at 12:40:08PM +0400, Yury Gribov wrote: >> When typing 'make .local.vimrc' in GCC build directory one would expect >> .local.vimrc to be created at the root of build directory, not srcdir. > > Yes, you would not expect it to do anything to your source dir, ever :-) But that's already the case for some other GCC targets e.g. "make TAGS". So I'm just following an established practice here. >>> Or not mention it at all. Esp. since your next option >>> has all the same functionality and more. >> >> It lacks very important functionality: user has to specify path >> to concrete GCC source tree when adding the autocmd. > > I was talking about mbr's plugin here :-) Ah, ok. Then I'll mention thinca's plugin as a secondary option with a disclaimer then. >>>> +" Or if you dislike plugins, add autocmd in your ~/.vimrc: >>>> +" :au BufNewFile,BufReadPost path/to/gcc/* :so >> path/to/gcc/contrib/vimrc >>> >>> There are many more reasons than just "dislike of plugins" to prefer >>> something like this. For one thing, many Vim users will have many >>> similar statements in their config _already_. >> >> So "if you don't want to use plugins"? > > Just mention it as another option? Something like > "You can add these options to your .vimrc; or you can :source this script > file; or do either with an :autocmd; or use e.g. the > plugin ". Don't say "do X if Y"; let people decide for > themselves what fits their situation best. Ok. >>>> +" Or just source file manually every time if you are masochist: >>>> +" :so path/to/gcc/contrib/vimrc >>> >>> How is that masochist? Typing that cino by hand though, now that would >>> qualify ;-) >> >> Note that user has to type source command for every newly opened file. >> This indeed looks inconvenient (to me again). > > Well for most people it is justt ":so contrib/vimrc". Or just ":lo" if > you're talking about crazy people with views. For many people that would be a hassle (judging by my colleagues). > I was suggesting you could write it as > :set cino=>4,n-2,{2,^-2,:2,=2,g0,f0,h2,p4,t0,+2,(0,u0,w1,m0 > and you'd be independent of sw setting. > ... > And yeah sw=2 does make sense for editing GCC, if you are used to sw=2 > that is. The point is that the sw setting has nothing to do with what > your text will look like, only with what keys you press. Depending on whether you treat shiftwidth as "amount of spaces that is inserted when I press >" or "default indent for a particular class of files". For example with shiftwidth=2 user could (un)indent block of C code with < or > which seems to be useful. > The coding standard says > "indent two spaces" etc. anyway. That's what I meant by "matching with GNU indent". >>>> + setlocal textwidth=79 >>> >>> The coding conventions say maximum line length is 80. >> >> From https://www.gnu.org/prep/standards/html_node/Formatting.html : >> "Please keep the length of source lines to 79 characters or less, for >> maximum readability in the widest range of environments." > > There is a doc on gcc.gnu.org as well, which describes many more details. Indeed: "Lines shall be at most 80 columns" (from https://gcc.gnu.org/codingconventions.html#Line). -Y