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

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

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Dec 10, 2020, 03:50 UTC
Message-ID
<X9GbIG9vZbK1pEoi@camp.crustytoothpaste.net>
In-Reply-To
<20201209065537.48802-2-felipe.contreras@gmail.com>
On 2020-12-09 at 06:55:36, Felipe Contreras wrote:
Show 26 quoted lines
> diff --git a/.vimrc b/.vimrc
> new file mode 100644
> index 0000000000..602c746477
> --- /dev/null
> +++ b/.vimrc
> @@ -0,0 +1,22 @@
> +" To make use of these configurations install the git plugin provided in
> +" the contrib section:
> +"
> +"   cp -aT contrib/vim ~/.vim/pack/plugins/start/git
> +"
> +" Then whitelist the location of this directory to your ~/.vimrc:
> +"
> +"   let g:gitvimrc_whitelist = [ expand('$HOME') . '/dev/git' ]
> +"
> +" You can add multiple locations, or specify a regexp pattern.
> +"
> +
> +augroup git
> +	au BufRead,BufNewFile */Documentation/*.txt set filetype=asciidoc
> +
> +	au FileType c setl noexpandtab tabstop=8 shiftwidth=0 cino=(s,:0,l1,t0
> +	au FileType sh setl noexpandtab tabstop=8 shiftwidth=0
> +	au FileType perl setl noexpandtab tabstop=8 shiftwidth=0
> +	au FileType asciidoc setl noexpandtab tabstop=8 shiftwidth=0 autoindent
> +augroup END

I don't think this should go in this location. It should go in contrib. Here's why:

* We should not ship editor-specific files in the main directory of the
  repository.  Even though Vim is very popular, it is one of many
  editors, and it is not even the most popular editor (which is now VS
  Code).  We have editor-independent files, and users can copy this into
  the root of the repository and ignore it if they want it there.
* Whether a user wants to use automatic indentation is a personal
  preference.  I do happen to like it, but there are others who don't
  and prefer to leave it off.  Similarly, whether to use cindent,
  smartindent, or autoindent is a preference, as is which cindent
  options to use (I use different ones).
* These settings affect every file that's loaded in the same editor
  process.  While many people open different editor windows for
  different projects, other people prefer to use the client-server
  functionality to load all of their projects in the same editor.  These
  are not, for example, the editor settings I normally use for non-Git
  AsciiDoc files.

So while I agree that these are common settings, they are not universally applicable, even for Vim and Neovim users, and we shouldn't try to claim that all or even most Vim and Neovim users should use them. In contrast, the .editorconfig file specifies things which are (a) guaranteed to affect only this repository and (b) are essential parts of our coding style. It notably omits things like line endings which are a matter of user or platform preference.

So I think contrib makes more sense here.
-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US
Previous: Felipe ContrerasNext: Felipe Contreras
Message 10 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.