{"thread":{"id":"54800","subject":"[PATCH] Add project-wide .vimrc configuration","startedAt":"2020-12-09T00:27:28Z","lastAt":"2020-12-09T16:19:42Z","messageCount":15,"participants":["Felipe Contreras","Junio C Hamano","Aaron Schrab","Denton Liu","brian m. carlson","Randall S. Becker"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"411798","messageId":"20201209002619.25468-1-felipe.contreras@gmail.com","threadId":"54800","inReplyTo":null,"subject":"[PATCH] Add project-wide .vimrc configuration","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2020-12-09T00:26:19Z","receivedAt":"2020-12-09T00:27:28Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"It's not efficient that everyone must set specific configurations in all\ntheir ~/.vimrc files; we can have a project-wide .vimrc that everyone\ncan use.\n\nBy default it's ignored, you need the following in your ~/.vimrc\n\n  set exrc\n  set secure\n\nThen the project-wide configuration is loaded, which sets the correct\nfiletype for the documentation and tests, and also the default\nindentation of c, sh, and asciidoc files.\n\nIf you have the shareness syntax file it will be used for the tests, but\nif not the sh syntax will still be used.\n\nThese default configurations can be overriden in the typical way (by\nadding the corresponding file in ~/.vim/after/ftplugin).\n\nWe could add the vim modelines at the bottom of every file, like other\nprojects do, but this seems more sensible.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n .vimrc | 9 +++++++++\n 1 file changed, 9 insertions(+)\n create mode 100644 .vimrc\n\ndiff --git a/.vimrc b/.vimrc\nnew file mode 100644\nindex 0000000000..d250ab26e0\n--- /dev/null\n+++ b/.vimrc\n@@ -0,0 +1,9 @@\n+augroup git\n+  au!\n+  au BufRead,BufNewFile */t/*.sh set ft=sharness.sh\n+  au BufRead,BufNewFile */Documentation/*.txt set ft=asciidoc\n+\n+  au FileType c setl noet ts=8 sw=0 cino=(s,:0,l1,t0\n+  au FileType sh setl noet ts=8 sw=0\n+  au FileType asciidoc setl noet ts=8 sw=0 autoindent\n+augroup END\n-- \n2.29.2\n\n"},{"id":"411800","messageId":"xmqqy2i74wgv.fsf@gitster.c.googlers.com","threadId":"54800","inReplyTo":"20201209002619.25468-1-felipe.contreras@gmail.com","subject":"Re: [PATCH] Add project-wide .vimrc configuration","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-12-09T01:08:48Z","receivedAt":"2020-12-09T01:09:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> It's not efficient that everyone must set specific configurations in all\n> their ~/.vimrc files; we can have a project-wide .vimrc that everyone\n> can use.\n\nDoes .vimrc gets used from the current directory?  If so, just like\nclang-format, it makes sense to place it with dot-prefix at the root\nof the project, like this patch does.  But ...\n\n>\n> By default it's ignored, you need the following in your ~/.vimrc\n>\n>   set exrc\n>   set secure\n\n... it does not sound like it is the case.\n\nAnd I am sensing that this \".vimrc that happens in the current\ndirectory is not used by default\" is not such a well known fact\namong vim users (otherwise you wouldn't be writing it here), and if\nthat is the case, I am afraid that this invites an unneeded end-user\nconfusion when they see dot-commandname-rc file and see its contents\nnot honored at all.\n\nWhether it is well known by intended audience that it is by default\nunused, we should give the instruction we see above (and below, up\nto the description of how to override) in a comment at the beginning\nof the file, I think.  Then, once the user follows the insn, the new\nfile added by this patch would start working without any further user\naction, which is very nice.\n\n> Then the project-wide configuration is loaded, which sets the correct\n> filetype for the documentation and tests, and also the default\n> indentation of c, sh, and asciidoc files.\n>\n> If you have the shareness syntax file it will be used for the tests, but\n> if not the sh syntax will still be used.\n>\n> These default configurations can be overriden in the typical way (by\n> adding the corresponding file in ~/.vim/after/ftplugin).\n>\n> We could add the vim modelines at the bottom of every file, like other\n> projects do, but this seems more sensible.\n>\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  .vimrc | 9 +++++++++\n>  1 file changed, 9 insertions(+)\n>  create mode 100644 .vimrc\n>\n> diff --git a/.vimrc b/.vimrc\n> new file mode 100644\n> index 0000000000..d250ab26e0\n> --- /dev/null\n> +++ b/.vimrc\n> @@ -0,0 +1,9 @@\n> +augroup git\n> +  au!\n> +  au BufRead,BufNewFile */t/*.sh set ft=sharness.sh\n> +  au BufRead,BufNewFile */Documentation/*.txt set ft=asciidoc\n> +\n> +  au FileType c setl noet ts=8 sw=0 cino=(s,:0,l1,t0\n> +  au FileType sh setl noet ts=8 sw=0\n> +  au FileType asciidoc setl noet ts=8 sw=0 autoindent\n> +augroup END\n"},{"id":"411802","messageId":"X9Al3u9/jw3QWN7q@pug.qqx.org","threadId":"54800","inReplyTo":"20201209002619.25468-1-felipe.contreras@gmail.com","subject":"Re: [PATCH] Add project-wide .vimrc configuration","fromName":"Aaron Schrab","fromEmail":"aaron@schrab.com","sentAt":"2020-12-09T01:18:22Z","receivedAt":"2020-12-09T01:29:25Z","isPatch":true,"sender":{"key":"aaron@schrab.com","avatar":"https://avatars.githubusercontent.com/u/39620?v=4"},"body":"At 18:26 -0600 08 Dec 2020, Felipe Contreras <felipe.contreras@gmail.com> wrote:\n>By default it's ignored, you need the following in your ~/.vimrc\n>\n>  set exrc\n\nRunning `:help 'exrc'` in vim includes the text:\n\n         Setting this option is a potential security leak.  E.g., consider\n         unpacking a package or fetching files from github, a .vimrc in there\n         might be a trojan horse.  BETTER NOT SET THIS OPTION!\n         Instead, define an autocommand in your .vimrc to set options for a\n         matching directory.\n\nSo I don't think it's a good idea to encourage people to do that by \nusing a name that invites it. Also I think that the file would be more \ndiscoverable for people to incorporate into their own configuration if \nnot named as a hidden file.\n"},{"id":"411804","messageId":"X9ApG0jUxJrPDK9d@generichostname","threadId":"54800","inReplyTo":"20201209002619.25468-1-felipe.contreras@gmail.com","subject":"Re: [PATCH] Add project-wide .vimrc configuration","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2020-12-09T01:32:11Z","receivedAt":"2020-12-09T01:32:57Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Hi Felipe,\n\nOn Tue, Dec 08, 2020 at 06:26:19PM -0600, Felipe Contreras wrote:\n> It's not efficient that everyone must set specific configurations in all\n> their ~/.vimrc files; we can have a project-wide .vimrc that everyone\n> can use.\n> \n> By default it's ignored, you need the following in your ~/.vimrc\n> \n>   set exrc\n>   set secure\n> \n> Then the project-wide configuration is loaded, which sets the correct\n> filetype for the documentation and tests, and also the default\n> indentation of c, sh, and asciidoc files.\n> \n> If you have the shareness syntax file it will be used for the tests, but\n\ns/shareness/sharness/\n\n> if not the sh syntax will still be used.\n> \n> These default configurations can be overriden in the typical way (by\n> adding the corresponding file in ~/.vim/after/ftplugin).\n> \n> We could add the vim modelines at the bottom of every file, like other\n> projects do, but this seems more sensible.\n> \n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  .vimrc | 9 +++++++++\n>  1 file changed, 9 insertions(+)\n>  create mode 100644 .vimrc\n> \n> diff --git a/.vimrc b/.vimrc\n> new file mode 100644\n> index 0000000000..d250ab26e0\n> --- /dev/null\n> +++ b/.vimrc\n> @@ -0,0 +1,9 @@\n> +augroup git\n> +  au!\n> +  au BufRead,BufNewFile */t/*.sh set ft=sharness.sh\n> +  au BufRead,BufNewFile */Documentation/*.txt set ft=asciidoc\n> +\n> +  au FileType c setl noet ts=8 sw=0 cino=(s,:0,l1,t0\n> +  au FileType sh setl noet ts=8 sw=0\n> +  au FileType asciidoc setl noet ts=8 sw=0 autoindent\n> +augroup END\n\nA couple of nits. We should tab-indent this file since the rest of the\nproject uses tabs everywhere. Also, perhaps use the full name for the\noption names so that it's immediately obvious what each setting does?\n\nAside from that, the settings themselves are sensible and I'm for this\npatch.\n\n-Denton\n\n> -- \n> 2.29.2\n> \n"},{"id":"411806","messageId":"X9A1On3v35nEjL7i@camp.crustytoothpaste.net","threadId":"54800","inReplyTo":"20201209002619.25468-1-felipe.contreras@gmail.com","subject":"Re: [PATCH] Add project-wide .vimrc configuration","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-12-09T02:23:54Z","receivedAt":"2020-12-09T02:25:19Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-12-09 at 00:26:19, Felipe Contreras wrote:\n> It's not efficient that everyone must set specific configurations in all\n> their ~/.vimrc files; we can have a project-wide .vimrc that everyone\n> can use.\n> \n> By default it's ignored, you need the following in your ~/.vimrc\n> \n>   set exrc\n>   set secure\n\nI would strongly recommend against advising users to use this\nconfiguration.  Vim has been known to have repeated security problems\nwith what options are allowed in restricted environments, and even with\nthe secure option, it's still easy to do something like this:\n\n  func Foo()\n    !echo >/tmp/foo\n  endfunction\n\n  nmap i :call Foo()<CR>\n\nWhen the user hits \"i\" to enter insert mode, they'll execute the\nattacker's arbitrary code.\n\n> We could add the vim modelines at the bottom of every file, like other\n> projects do, but this seems more sensible.\n\nWe have an .editorconfig file[0], which is a cross-editor file that can be\nused to specify these settings.  It is supported by many editors out of\nthe box, although Vim requires a plugin.  Since we don't want to support\nconfiguration for every editor under the sun, it makes sense to use a\nsingle file for multiple editors and let people configure their editor\naccordingly.\n\nSince Vim would require configuration either way and .editorconfig files\ndon't have any known security issues, the .editorconfig file seems like\na better option.\n\n[0] https://editorconfig.org/\n-- \nbrian m. carlson (he/him or they/them)\nHouston, Texas, US\n"},{"id":"411807","messageId":"CAMP44s0nno90=xKmiZ0=PYQKraSwev7hmEUXfHoFDU3FR37KCw@mail.gmail.com","threadId":"54800","inReplyTo":"xmqqy2i74wgv.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] Add project-wide .vimrc configuration","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2020-12-09T02:32:32Z","receivedAt":"2020-12-09T02:33:46Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, Dec 8, 2020 at 7:08 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n> > It's not efficient that everyone must set specific configurations in all\n> > their ~/.vimrc files; we can have a project-wide .vimrc that everyone\n> > can use.\n>\n> Does .vimrc gets used from the current directory?  If so, just like\n> clang-format, it makes sense to place it with dot-prefix at the root\n> of the project, like this patch does.  But ...\n\nActually no. I tested this with \"vim Documentation/git-pull.txt\", and\nthat works fine, but apparently only from that directory.\n\nI'm investigating other solutions.\n\n> > By default it's ignored, you need the following in your ~/.vimrc\n> >\n> >   set exrc\n> >   set secure\n>\n> ... it does not sound like it is the case.\n>\n> And I am sensing that this \".vimrc that happens in the current\n> directory is not used by default\" is not such a well known fact\n> among vim users (otherwise you wouldn't be writing it here), and if\n> that is the case, I am afraid that this invites an unneeded end-user\n> confusion when they see dot-commandname-rc file and see its contents\n> not honored at all.\n\nI'd say at least 90% of what vim does is not well known for most vim uses.\n\n> Whether it is well known by intended audience that it is by default\n> unused, we should give the instruction we see above (and below, up\n> to the description of how to override) in a comment at the beginning\n> of the file, I think.  Then, once the user follows the insn, the new\n> file added by this patch would start working without any further user\n> action, which is very nice.\n\nRight. That makes sense. I'll add the instructions to the next version\nonce I find a good alternative for exrc.\n\nCheers.\n\n-- \nFelipe Contreras\n"},{"id":"411810","messageId":"xmqqblf34ql8.fsf@gitster.c.googlers.com","threadId":"54800","inReplyTo":"X9Al3u9/jw3QWN7q@pug.qqx.org","subject":"Re: [PATCH] Add project-wide .vimrc configuration","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-12-09T03:15:47Z","receivedAt":"2020-12-09T03:16:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Aaron Schrab <aaron@schrab.com> writes:\n\n> At 18:26 -0600 08 Dec 2020, Felipe Contreras <felipe.contreras@gmail.com> wrote:\n>>By default it's ignored, you need the following in your ~/.vimrc\n>>\n>>  set exrc\n>\n> Running `:help 'exrc'` in vim includes the text:\n>\n>         Setting this option is a potential security leak.  E.g., consider\n>         unpacking a package or fetching files from github, a .vimrc in there\n>         might be a trojan horse.  BETTER NOT SET THIS OPTION!\n>         Instead, define an autocommand in your .vimrc to set options for a\n>         matching directory.\n>\n> So I don't think it's a good idea to encourage people to do that by\n> using a name that invites it. Also I think that the file would be more \n> discoverable for people to incorporate into their own configuration if\n> not named as a hidden file.\n\nThanks.  I do not use vim and did not know how commonly recommended\nthe \"set exrc\" would be, but what you said makes total sense.  In\nthat case, I'd suggest shipping this file without the dot-prefix\nwith a clear instruction how to make use of its contents in a secure\nmanner in a comment at the top of the file.\n\nIf having vimrc (no dot) at the top-level of the tree is untidy, we\ncan add a place in contrib/ that houses configurations to help\nvarious editors and IDEs (e.g. contrib/editors/), too.\n"},{"id":"411817","messageId":"CAMP44s1fNwC+AfnPJxhG=24Zt5NFE5SoZZXpGEb-jcc+3QSg9A@mail.gmail.com","threadId":"54800","inReplyTo":"X9ApG0jUxJrPDK9d@generichostname","subject":"Re: [PATCH] Add project-wide .vimrc configuration","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2020-12-09T06:20:20Z","receivedAt":"2020-12-09T06:21:14Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, Dec 8, 2020 at 7:32 PM Denton Liu <liu.denton@gmail.com> wrote:\n> On Tue, Dec 08, 2020 at 06:26:19PM -0600, Felipe Contreras wrote:\n\n> > diff --git a/.vimrc b/.vimrc\n> > new file mode 100644\n> > index 0000000000..d250ab26e0\n> > --- /dev/null\n> > +++ b/.vimrc\n> > @@ -0,0 +1,9 @@\n> > +augroup git\n> > +  au!\n> > +  au BufRead,BufNewFile */t/*.sh set ft=sharness.sh\n> > +  au BufRead,BufNewFile */Documentation/*.txt set ft=asciidoc\n> > +\n> > +  au FileType c setl noet ts=8 sw=0 cino=(s,:0,l1,t0\n> > +  au FileType sh setl noet ts=8 sw=0\n> > +  au FileType asciidoc setl noet ts=8 sw=0 autoindent\n> > +augroup END\n>\n> A couple of nits. We should tab-indent this file since the rest of the\n> project uses tabs everywhere. Also, perhaps use the full name for the\n> option names so that it's immediately obvious what each setting does?\n\nAll right, makes sense to me.\n\n-- \nFelipe Contreras\n"},{"id":"411818","messageId":"CAMP44s3-38WJXxzFJhhxvB-PVNzRuu+oaC3aVb=VF+P42S8WOw@mail.gmail.com","threadId":"54800","inReplyTo":"X9Al3u9/jw3QWN7q@pug.qqx.org","subject":"Re: [PATCH] Add project-wide .vimrc configuration","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2020-12-09T06:28:05Z","receivedAt":"2020-12-09T06:29:14Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, Dec 8, 2020 at 7:18 PM Aaron Schrab <aaron@schrab.com> wrote:\n>\n> At 18:26 -0600 08 Dec 2020, Felipe Contreras <felipe.contreras@gmail.com> wrote:\n> >By default it's ignored, you need the following in your ~/.vimrc\n> >\n> >  set exrc\n>\n> Running `:help 'exrc'` in vim includes the text:\n>\n>          Setting this option is a potential security leak.  E.g., consider\n>          unpacking a package or fetching files from github, a .vimrc in there\n>          might be a trojan horse.  BETTER NOT SET THIS OPTION!\n>          Instead, define an autocommand in your .vimrc to set options for a\n>          matching directory.\n\nYeah, but if they *really* didn't want people to set this option they\nwould remove it.\n\nYes, it's dangerous, but that's why it's an option.\n\nAnyway, I wrote a simple loader that should take care of this security\nrisk, in the same way other local vimrc loaders do.\n\n> So I don't think it's a good idea to encourage people to do that by\n> using a name that invites it. Also I think that the file would be more\n> discoverable for people to incorporate into their own configuration if\n> not named as a hidden file.\n\nPerhaps. There's already an .editorconfig so we would be following\nsimilar steps, and also this is what other vimrc loaders already use.\n\nSince I'm adding a contrib/vim directory maye a README file would make sense.\n\nCheck v2 and let me know what you think.\n\n-- \nFelipe Contreras\n"},{"id":"411819","messageId":"CAMP44s0W3En0ZuNfBOOZhfeFUeFRvEFs7khAFRraocuDaFpbNA@mail.gmail.com","threadId":"54800","inReplyTo":"X9A1On3v35nEjL7i@camp.crustytoothpaste.net","subject":"Re: [PATCH] Add project-wide .vimrc configuration","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2020-12-09T06:36:16Z","receivedAt":"2020-12-09T06:37:23Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, Dec 8, 2020 at 8:24 PM brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n>\n> On 2020-12-09 at 00:26:19, Felipe Contreras wrote:\n> > It's not efficient that everyone must set specific configurations in all\n> > their ~/.vimrc files; we can have a project-wide .vimrc that everyone\n> > can use.\n> >\n> > By default it's ignored, you need the following in your ~/.vimrc\n> >\n> >   set exrc\n> >   set secure\n>\n> I would strongly recommend against advising users to use this\n> configuration.  Vim has been known to have repeated security problems\n> with what options are allowed in restricted environments, and even with\n> the secure option, it's still easy to do something like this:\n>\n>   func Foo()\n>     !echo >/tmp/foo\n>   endfunction\n>\n>   nmap i :call Foo()<CR>\n>\n> When the user hits \"i\" to enter insert mode, they'll execute the\n> attacker's arbitrary code.\n\nv2 should probably deal with that.\n\n> > We could add the vim modelines at the bottom of every file, like other\n> > projects do, but this seems more sensible.\n>\n> We have an .editorconfig file[0], which is a cross-editor file that can be\n> used to specify these settings.  It is supported by many editors out of\n> the box, although Vim requires a plugin.  Since we don't want to support\n> configuration for every editor under the sun, it makes sense to use a\n> single file for multiple editors and let people configure their editor\n> accordingly.\n\nSure. But it doesn't set cinoptions, nor does it set filetypes for\ndocumentation and tests.\n\nPlus, it's a single file, it's not like we are adding modesets at the\nbottom of every single file like other projects do.\n\nAlso, we don't have to support configurations for every editor under\nthe sun, that's a slippery slope fallacy.\n\nWe can stop at 1 editor: the most widely used editor by developers by far [1].\n\nCheers.\n\n[1] https://pkgstats.archlinux.de/packages#query=vim\n\n-- \nFelipe Contreras\n"},{"id":"411821","messageId":"xmqqlfe731vh.fsf@gitster.c.googlers.com","threadId":"54800","inReplyTo":"CAMP44s0W3En0ZuNfBOOZhfeFUeFRvEFs7khAFRraocuDaFpbNA@mail.gmail.com","subject":"Re: [PATCH] Add project-wide .vimrc configuration","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-12-09T06:54:58Z","receivedAt":"2020-12-09T06:55:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n>> We have an .editorconfig file[0], which is a cross-editor file that can be\n>> used to specify these settings.  It is supported by many editors out of\n> ...\n> Also, we don't have to support configurations for every editor under\n> the sun, that's a slippery slope fallacy.\n>\n> We can stop at 1 editor: the most widely used editor by developers by far [1].\n>\n> Cheers.\n>\n> [1] https://pkgstats.archlinux.de/packages#query=vim\n\nIt shows 71% (for vim-runtime), that is a lot higher than ~20% for\nemacs.\n\nAmusingly, https://pkgstats.archlinux.de/packages#query=nano tells\nus that nano clicks at 80%, which makes it the editor with the\nlargest number with your yardstick ;-) [*2*].\n\nIn any case, I think it is a worthy goal to ship a sample set of\n\"vimrc\" entries that people can readily accept for their use.  It\nalso is a reasonable \"feature request\" to consider doing something\nsimilar to \"editorconfig\" to give other editors similar convenience.\n\n\n[Footnote]\n\n*2* In other words, I doubt these graphs are depicting \"how widely\nis an editor used by developers\".  It is just showing how often it\nis installed, and I know the primary workstation I use daily has vim\nand nano installed without me choosing to have them, as opposed to\nemacs I had to manually install, and I only use vim once every month\nand nano once every quarter.\n\nNote that I do not doubt vim is popular.  It is popular and it makes\nsense to include it in the set of \"first class\" editors that deserve\npriority treatment when we allocate engineering effort to support.\n\nI just do not think these graphs are the best supporting material\nfor the claim you made \"the most widely used editor by developers\".\n"},{"id":"411826","messageId":"CAMP44s2xo=n4z6m7FhuPiZ66yPWvmdQuAodvh2XNpdVAfo6R8g@mail.gmail.com","threadId":"54800","inReplyTo":"xmqqlfe731vh.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] Add project-wide .vimrc configuration","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2020-12-09T07:16:14Z","receivedAt":"2020-12-09T07:17:08Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, Dec 9, 2020 at 12:55 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n> >> We have an .editorconfig file[0], which is a cross-editor file that can be\n> >> used to specify these settings.  It is supported by many editors out of\n> > ...\n> > Also, we don't have to support configurations for every editor under\n> > the sun, that's a slippery slope fallacy.\n> >\n> > We can stop at 1 editor: the most widely used editor by developers by far [1].\n> >\n> > Cheers.\n> >\n> > [1] https://pkgstats.archlinux.de/packages#query=vim\n>\n> It shows 71% (for vim-runtime), that is a lot higher than ~20% for\n> emacs.\n>\n> Amusingly, https://pkgstats.archlinux.de/packages#query=nano tells\n> us that nano clicks at 80%, which makes it the editor with the\n> largest number with your yardstick ;-) [*2*].\n\nRight. But I doubt there's many git developers using nano.\n\nAnyway, that's not my yardstick, I just recall I've seen multiple\nsurveys of the editors that developers use, and vim always comes at\nthe top, by far. I just quickly searched for some evidence to sustain\nmy notion.\n\n> In any case, I think it is a worthy goal to ship a sample set of\n> \"vimrc\" entries that people can readily accept for their use.  It\n> also is a reasonable \"feature request\" to consider doing something\n> similar to \"editorconfig\" to give other editors similar convenience.\n\nIndeed. Editors are kind of a touchy subject, but I don't think\nanybody can deny that vim and emacs are the two most popular. My only\npoint is that we don't have to support \"every editor under the sun\".\n\nCheers.\n\n> [Footnote]\n>\n> *2* In other words, I doubt these graphs are depicting \"how widely\n> is an editor used by developers\".  It is just showing how often it\n> is installed, and I know the primary workstation I use daily has vim\n> and nano installed without me choosing to have them, as opposed to\n> emacs I had to manually install, and I only use vim once every month\n> and nano once every quarter.\n\nYes, but in Arch Linux at least no editor is installed by default.\n\n-- \nFelipe Contreras\n"},{"id":"411829","messageId":"CAMP44s1vJj6QJjS8ApM_wiVunPo6093_4M-ghJB_PTqZhnmm0A@mail.gmail.com","threadId":"54800","inReplyTo":"xmqqh7ov2y97.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] Add project-wide .vimrc configuration","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2020-12-09T08:52:57Z","receivedAt":"2020-12-09T08:53:51Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, Dec 9, 2020 at 2:13 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n> >> *2* In other words, I doubt these graphs are depicting \"how widely\n> >> is an editor used by developers\".  It is just showing how often it\n> >> is installed, and I know the primary workstation I use daily has vim\n> >> and nano installed without me choosing to have them, as opposed to\n> >> emacs I had to manually install, and I only use vim once every month\n> >> and nano once every quarter.\n> >\n> > Yes, but in Arch Linux at least no editor is installed by default.\n>\n> I thought everybody has nano not because it is adequate and usable\n> for them, but because it comes by default with distros, and distro\n> in turn choose nano not because it is particularly popular but is\n> small enough not to matter if left behind unused when the user\n> chooses a real editor.\n>\n> But you are essentially usaying that 80% of Arch users install nano\n> by choice.  I find it doubly surprising.\n\nI double checked. The installation instructions [1] do tell you to\npick an editor, and they don't suggest any.\n\nI am half-surprised. The StackOverflow question \"How do I exit the Vim\neditor?\" has 2.2 million views [2], there's countless memes about that\nordeal [3], and the SO team even found it wise to write a blog post\nabout it [4]. I don't know how to exit emacs (Ctrl-X Ctrl-e?), and I\nsuspect many emacs users don't know how to exit vim.\n\nNano doesn't have this problem. Which means for somebody entering the\nworld of Linux, that's a plus.\n\nCheers.\n\n[1] https://wiki.archlinux.org/index.php/Installation_guide#Install_essential_packages\n[2] https://stackoverflow.com/questions/11828270/how-do-i-exit-the-vim-editor\n[3] https://twitter.com/iamdevloper/status/993821761648103425\n[4] https://stackoverflow.blog/2017/05/23/stack-overflow-helping-one-million-developers-exit-vim/\n\n\n--\nFelipe Contreras\n"},{"id":"411873","messageId":"xmqqh7ov2y97.fsf@gitster.c.googlers.com","threadId":"54800","inReplyTo":"CAMP44s2xo=n4z6m7FhuPiZ66yPWvmdQuAodvh2XNpdVAfo6R8g@mail.gmail.com","subject":"Re: [PATCH] Add project-wide .vimrc configuration","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-12-09T08:13:08Z","receivedAt":"2020-12-09T15:48:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n>> *2* In other words, I doubt these graphs are depicting \"how widely\n>> is an editor used by developers\".  It is just showing how often it\n>> is installed, and I know the primary workstation I use daily has vim\n>> and nano installed without me choosing to have them, as opposed to\n>> emacs I had to manually install, and I only use vim once every month\n>> and nano once every quarter.\n>\n> Yes, but in Arch Linux at least no editor is installed by default.\n\nI thought everybody has nano not because it is adequate and usable\nfor them, but because it comes by default with distros, and distro\nin turn choose nano not because it is particularly popular but is\nsmall enough not to matter if left behind unused when the user\nchooses a real editor.\n\nBut you are essentially usaying that 80% of Arch users install nano\nby choice.  I find it doubly surprising.\n\n"},{"id":"411883","messageId":"01a801d6ce46$f2cad520$d8607f60$@nexbridge.com","threadId":"54800","inReplyTo":"xmqqh7ov2y97.fsf@gitster.c.googlers.com","subject":"RE: [PATCH] Add project-wide .vimrc configuration","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2020-12-09T16:18:31Z","receivedAt":"2020-12-09T16:19:42Z","isPatch":true,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On December 9, 2020 3:13 AM, Junio C Hamano wrote:\n> To: Felipe Contreras <felipe.contreras@gmail.com>\n> Cc: brian m. carlson <sandals@crustytoothpaste.net>; Git\n> <git@vger.kernel.org>; Jeff King <peff@peff.net>; Emily Shaffer\n> <emilyshaffer@google.com>\n> Subject: Re: [PATCH] Add project-wide .vimrc configuration\n> \n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n> \n> >> *2* In other words, I doubt these graphs are depicting \"how widely is\n> >> an editor used by developers\".  It is just showing how often it is\n> >> installed, and I know the primary workstation I use daily has vim and\n> >> nano installed without me choosing to have them, as opposed to emacs\n> >> I had to manually install, and I only use vim once every month and\n> >> nano once every quarter.\n> >\n> > Yes, but in Arch Linux at least no editor is installed by default.\n> \n> I thought everybody has nano not because it is adequate and usable for\n> them, but because it comes by default with distros, and distro in turn\nchoose\n> nano not because it is particularly popular but is small enough not to\nmatter\n> if left behind unused when the user chooses a real editor.\n> \n> But you are essentially usaying that 80% of Arch users install nano by\nchoice.\n> I find it doubly surprising.\n\nI know of perhaps 3 or 4 nano users in the NonStop community. There are\nprobably three orders of magnitude more vi/vim users. vim and vi both come\ninstalled on the platform by default. Nano is an add-on that my team builds\nas a courtesy but there's small interest but it is loyal.\n\nRegards,\nRandall\n\n"}]}