Settings

Theme

ShowHN: Scraped 800 .vimrc files from github, analyzed for fun

mcphersonindustries.com

12 points by AlexMcP 13 years ago · 17 comments

Reader

malkia 13 years ago

Would love to see something similar for "emacs"

I just learned something new for example today - using the ".dir-locals.el" to specify per-directory variables :)

I want to learn vi/vim, but spent already so much time learning emacs (and still feeling baby in it... which is good!)

  • snogglethorpe 13 years ago

    > spent already so much time learning emacs (and still feeling baby in it... which is good!)

    Nobody has really mastered Emacs. Nobody.

    There's simply too much detail, much of it hidden in the shadows.

recoil 13 years ago

It's interesting that "set autoindent" is so common. I replaced this with "filetype indent on" some years ago, since I'd rather have language-sensitive indentation.

chrismorgan 13 years ago

Normalisation of settings would be a very good thing to do. 'ruler' and 'ru', 'autoindent' and 'ai', 'etc.' and 'et cetera'.

  • AlexMcPOP 13 years ago

    I'll work on combining these; as a vim neophyte I wasn't totally sure which ones might overlap. At least I got color|colorscheme.

    Thanks!

    • johncoltrane 13 years ago

      When you do :help autoindent or :help ai you can see the short version and the long version.

wamatt 13 years ago

Very cool project, thanks for sharing! :)

What could be interesting addition, would be to see how these change over time, ie .vimrc trends.

I had a similar idea for analyzing dotfiles stats, which was subsequently filed in evernote as a 'yet-another-hack-i-would-like-to-do-someday-but-realistically-probably-will-not' ;)

AlexMcPOP 13 years ago

Did this for fun mostly to test out casper.js (it's nice!)

I'd welcome any feedback on how to better present interesting data, or answer any questions. Thanks!

  • zissou 13 years ago

    I think you did a good job on the data presentation. I'm not even a vim user and I found it intuitive to understand the analysis you did (i.e. the question you wanted to ask) and the results of that analysis. Just generally speaking, I thought it was a very data science-esk solution. You had a curiosity (what settings do people use in their default vim config), you came up with a way to get data that could help shed light on that question (grab vim config files from a location that has a lot of people from a relevant sample (developers) revealing their vim config files -- github -- which you use as observations, even though the people who originally uploaded those files had no intentions on them being observations in some person's study), and then you presented various analyses of that data in a concise way.

    It may be a simple and trivial question to some, but more importantly, I think the methodology was very well done because I feel can trust your results, which should be the goal of ANY empirical analysis.

  • boofar 13 years ago

    Yeah, fun idea. So when I didn't recognize some of the options, I've looked them up with :help and of course "autoindent" and "ai" are the same, so should be really added together.

  • chid 13 years ago

    Will you release the source? I don't use any of the stuff you use, except vim, would be interested to have a look

johncoltrane 13 years ago

What a surprise: 574/800 useless set nocompatible. Cargo cult for the win!

  • AlexMcPOP 13 years ago

    What is it purported to do vs. what does it actually do?

    • johncoltrane 13 years ago

      Vim can run in "compatible" mode (Vi-like settings) or "nocompatible" mode (Vim-like settings).

          :set nocompatible
      
      is used to switch Vim from "compatible" mode to "nocompatible" mode.

      A lot of people put it at the top of their .vimrc, usually together with a comment telling that it's needed for many options and features to work correctly.

      But Vim actually switches itself to "nocompatible" mode if it finds a vimrc. It can be the default vimrc in /usr/share/vim/vim7x/ or your own .vimrc, it doesn't matter.

      You can test this by removing this line from your .vimrc, launching another Vim instance and doing :set compatible? With or without that line, you'll get nocompatible.

      Having this line in your .vimrc essentially does nothing: it sets something "on" that was already "on". As such it's useless cruft but it is not dangerous.

      The real problem with it is that it demonstrates a dangerous cargo cult trend among Vim users who copy/paste entire vimrcs from Github or top ranking blog posts without thinking about it for a second. Because this line and the comment appeared in a rather famous blog post(1) by a rather famous vimmer it's now just… everywhere.

      I have a lot of respect for Steve Losh and I absolutely don't blame him for including this line in his post: it's useless but harmless so there's no big deal. I certainly have a lot of useless redundant stuff in my .vimrc, too. And I'm totally guilty of using his whole .vimrc verbatim when I started.

      But all the people who copied this line from him or from others who copied it from others who copied it from him (who probably copied it from someone else, why not?) should show a little less lazyness, I believe. And a more critical mind.

      (1) http://stevelosh.com/blog/2010/09/coming-home-to-vim/

      • AlexMcPOP 13 years ago

        Hmm, maybe I'll get around to looking at his vimrc and seeing what proportion of the settings are in the scraped files. I bet I could further validate your cargo-cult hypothesis.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection