
The cleanest vimrc you'll ever see - skwp
http://yanpritzker.com/2012/01/20/the-cleanest-vimrc-youve-ever-seen/
======
evmar
My vimrc is cleaner:

    
    
        $ cat ~/.vimrc
        cat: /home/evanm/.vimrc: No such file or directory
    

I mean, it's cool and all that you love your tools, but I suspect these sorts
of blog posts are net harmful when you consider the number of people who will
read it and take it as an opportunity to fiddle around with settings in a
program as a way of further putting off making something meaningful.

~~~
hack_edu
This doesn't deserve downvotes. Its a legitimate, and smart, way of
approaching vi for a lot of reasons. In my opinion, it should be <10 lines

I'll agree with you though I like to have at least a few in there like
autoindent, various tabstop and search related settings, or syntax
highlighting.

~~~
asparagui
alias vim=pico

this is a good approach to vi, as well :P

~~~
lukeschlather

        alias vim=pico
        alias pico=nano
        alias nano=emacs

~~~
sliverstorm
It even represents the spirit of emacs!

;)

------
oacgnol
To me, it really doesn't matter if you maintain your plugin settings in your
.vimrc or in separate files, as long as it's well annotated and organized the
way you like it.

Plus, all I have to do is track my .vimrc in my dotfiles repo and let Vundle
manage my plugins for me.

------
lelele
I followed the modular init file approach at first, but keeping track of
dependencies between different modules was a chore. Having all of my
initialization code in a single file greatly simplifies maintenance: I could
instantly tell what code runs before or after a certain line and I could
easily navigate among sections of code and fold them based on headings.

Nowadays, my emacs init file is 239 kB. Is it messy? Yes, in some places, for
customizations I don't care that much, it is, because each section I rely on
constantly gets constantly refactored.

Modularization helps when you are going to share code among different
projects, but your init file is a single project, what does splitting it buys
you? Only increased complexity. Of course, as soon as functions get refactored
and made more general and independent, they go into a module of their own.

------
jdludlow
_Remap caps-lock to escape_

Ugh, why? Remapping caps-lock to Ctrl makes more sense to me. The Escape key
is still in the upper-left, and banging somewhere in that vicinity usually
hits it. Also Ctrl-C equals Escape in vim, so you still have quick access to
it from the home row if you want.

~~~
stevelosh
I remapped Capslock to:

"Ctrl if it's held down and pressed with another key, Escape if it's pressed
and released on its own."

It works really nicely once you get used to it.

EDIT:

To do that I first mapped Capslock to Ctrl using the normal Apple Keyboard
prefs, then used KeyRemap4MacBook and checked this setting:
<http://i.imgur.com/99cNs.png>

<http://pqrs.org/macosx/keyremap4macbook/>

~~~
jdludlow
I could definitely get used to that. Did you remap that in vim itself, or from
your operating system?

------
DiabloD3
But not the best: <https://github.com/Diablo-D3/dot_vim>

Edit: Woah, that guy needs to learn how to use Vundle and not embed third
party files in his git repo, and let Vundle fetch it for him (look at mine for
example)

~~~
mgrouchy
I think git submodules + pathogen is a perfectly legit way to
fetch/install/manage vim plugins.

~~~
DiabloD3
Except he didnt use git submodules, he embedded them right in his git repo,
which means he can never keep up to date.

Also, Vundle is pathogen inspired, its designed to be an easier way of doing
the same thing, complete with automated updating for gitted stuff.

~~~
mgrouchy
I know what vundle is.

Pretty sure we can't be looking at the same repo, because as far as I can
tell, these are git submodules
[https://img.skitch.com/20120120-jx8g6cpj8amdagh6dtfbyjtjbp.j...](https://img.skitch.com/20120120-jx8g6cpj8amdagh6dtfbyjtjbp.jpg)
(screenshot)

Re: Keeping up to date

    
    
        git submodule foreach git pull origin master --recurse-submodules

~~~
skwp
yep, they are proper git submodules, and this way you can specifically control
which of them you want to update, and when.

------
daniellockard
I have my vimrc on github as well. It gets the job done for me. Keep in mind
I'm far more of a sysadmin than a programmer.

<https://github.com/daniellockard/vimrc>

------
jh3
I've been meaning to clean up my vimrc. I think I may finally do it. Vundle
seems like it would be nicer to use, though.

------
njharman
This is an example of poor refactoring. Also, "cleanest" is not better.

