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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-12-09 at 06:55:36, Felipe Contreras wrote:
> 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

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux