git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>,
	Felipe Contreras <felipe.contreras@gmail.com>,
	Git <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>,
	Jeff King <peff@peff.net>,
	Emily Shaffer <emilyshaffer@google.com>
Subject: Re: [PATCH] Add project-wide .vimrc configuration
Date: Wed, 9 Dec 2020 00:36:16 -0600	[thread overview]
Message-ID: <CAMP44s0W3En0ZuNfBOOZhfeFUeFRvEFs7khAFRraocuDaFpbNA@mail.gmail.com> (raw)
In-Reply-To: <X9A1On3v35nEjL7i@camp.crustytoothpaste.net>

On Tue, Dec 8, 2020 at 8:24 PM brian m. carlson
<sandals@crustytoothpaste.net> wrote:
>
> On 2020-12-09 at 00:26:19, Felipe Contreras wrote:
> > It's not efficient that everyone must set specific configurations in all
> > their ~/.vimrc files; we can have a project-wide .vimrc that everyone
> > can use.
> >
> > By default it's ignored, you need the following in your ~/.vimrc
> >
> >   set exrc
> >   set secure
>
> I would strongly recommend against advising users to use this
> configuration.  Vim has been known to have repeated security problems
> with what options are allowed in restricted environments, and even with
> the secure option, it's still easy to do something like this:
>
>   func Foo()
>     !echo >/tmp/foo
>   endfunction
>
>   nmap i :call Foo()<CR>
>
> When the user hits "i" to enter insert mode, they'll execute the
> attacker's arbitrary code.

v2 should probably deal with that.

> > We could add the vim modelines at the bottom of every file, like other
> > projects do, but this seems more sensible.
>
> We have an .editorconfig file[0], which is a cross-editor file that can be
> used to specify these settings.  It is supported by many editors out of
> the box, although Vim requires a plugin.  Since we don't want to support
> configuration for every editor under the sun, it makes sense to use a
> single file for multiple editors and let people configure their editor
> accordingly.

Sure. But it doesn't set cinoptions, nor does it set filetypes for
documentation and tests.

Plus, it's a single file, it's not like we are adding modesets at the
bottom of every single file like other projects do.

Also, we don't have to support configurations for every editor under
the sun, that's a slippery slope fallacy.

We can stop at 1 editor: the most widely used editor by developers by far [1].

Cheers.

[1] https://pkgstats.archlinux.de/packages#query=vim

-- 
Felipe Contreras

  reply	other threads:[~2020-12-09  6:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09  0:26 [PATCH] Add project-wide .vimrc configuration Felipe Contreras
2020-12-09  1:08 ` Junio C Hamano
2020-12-09  2:32   ` Felipe Contreras
2020-12-09  1:18 ` Aaron Schrab
2020-12-09  3:15   ` Junio C Hamano
2020-12-09  6:28   ` Felipe Contreras
2020-12-09  1:32 ` Denton Liu
2020-12-09  6:20   ` Felipe Contreras
2020-12-09  2:23 ` brian m. carlson
2020-12-09  6:36   ` Felipe Contreras [this message]
2020-12-09  6:54     ` Junio C Hamano
2020-12-09  7:16       ` Felipe Contreras
2020-12-09  8:13         ` Junio C Hamano
2020-12-09  8:52           ` Felipe Contreras
2020-12-09 16:18           ` Randall S. Becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMP44s0W3En0ZuNfBOOZhfeFUeFRvEFs7khAFRraocuDaFpbNA@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).