git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/2] Add project-wide .vimrc configuration

From
Jeff King <peff@peff.net>
Date
Dec 15, 2020, 01:39 UTC
Message-ID
<X9gT57SAHzGm3ET2@coredump.intra.peff.net>
In-Reply-To
<X9Lf1p++YktzZMWe@camp.crustytoothpaste.net>
On Fri, Dec 11, 2020 at 02:56:22AM +0000, brian m. carlson wrote:
Show 10 quoted lines
> > > * We should not ship editor-specific files in the main directory of the
> > >   repository.
> > 
> > Why not?
> 
> Best practices indicate that we don't check in files which are specific
> to a developer.  Anything that controls the specific editor people use
> is by definition specific to the developer.  Checking in these files
> leads to conflicts over which settings to apply and whose settings are
> better when they could just be avoided.

I think that's a good general policy, but it's not unreasonable to help people make configure some widely used tools. The key things to me are:

  - we should do so at the most general level possible. I agree that
    .editorconfig is the right level for features it supports. But
    there are bits being suggested here that I think it does not (like
    how to indent case labels).
    We also have .clang-format, for which there's a vim plugin (but I've
    not used it, nor editorconfig, myself). It seems like it may support
    more options.
  - people who use the editor config take responsibility for maintaining
    it, and nobody else needs to care. E.g., I'd expect editorconfig to
    more of a source of truth than any vim config, and if there's a
    conflict for people who care about vim to sort it out (and not
    somebody who touched .editorconfig).
  - it doesn't suggest any actions that might be bad practices. I agree
    that the instructions for auto-loading this .vimrc are more
    complicated than necessary and might have security implications.
    Carrying a file in contrib/vim that says "copy this to ~/.vim/foo"
    or even "copy these lines to your ~/.vimrc" seems a lot safer. And
    it makes it easier for people who prefer to adapt the config to
    their own setup.

So I'm not opposed to carrying some vim config, but I think it's best to focus on simplicity and providing human-readable instructions, rather than ad-hoc plugin infrastructure.

-Peff
Previous: Felipe ContrerasNext: Felipe Contreras
Message 14 of 22 in “vim: configuration and sharness syntax”
  1. 0/2 vim: configuration and sharness syntaxFelipe Contreras, Dec 9, 2020
  2. 1/2 Add project-wide .vimrc configurationFelipe Contreras, Dec 9, 2020
  3. Christian BrabandtDec 9, 2020
  4. Felipe ContrerasDec 9, 2020
  5. Christian BrabandtDec 9, 2020
  6. Jeff KingDec 9, 2020
  7. Felipe ContrerasDec 10, 2020
  8. Jeff KingDec 10, 2020
  9. Felipe ContrerasDec 11, 2020
  10. brian m. carlsonDec 10, 2020
  11. Felipe ContrerasDec 11, 2020
  12. brian m. carlsonDec 11, 2020
  13. Felipe ContrerasDec 11, 2020
  14. Jeff KingDec 15, 2020
  15. Felipe ContrerasDec 15, 2020
  16. Jeff KingDec 15, 2020
  17. Felipe ContrerasDec 15, 2020
  18. 2/2 contrib: vim: add sharness syntax fileFelipe Contreras, Dec 9, 2020
  19. Eric SunshineDec 9, 2020
  20. Felipe ContrerasDec 9, 2020
  21. Jeff KingDec 9, 2020
  22. Felipe ContrerasDec 10, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.