All of lore.kernel.org
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: 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 02:23:54 +0000	[thread overview]
Message-ID: <X9A1On3v35nEjL7i@camp.crustytoothpaste.net> (raw)
In-Reply-To: <20201209002619.25468-1-felipe.contreras@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1536 bytes --]

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.

> 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.

Since Vim would require configuration either way and .editorconfig files
don't have any known security issues, the .editorconfig file seems like
a better option.

[0] https://editorconfig.org/
-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  parent reply	other threads:[~2020-12-09  2:25 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 [this message]
2020-12-09  6:36   ` Felipe Contreras
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=X9A1On3v35nEjL7i@camp.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=emilyshaffer@google.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.