13 ms·
The cleanest vimrc you'll ever see
- DiabloD3 15y agoBut not the best: https://github.com/Diablo-D3/dot_vim 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 15y agoI think git submodules + pathogen is a perfectly legit way to fetch/install/manage vim plugins.
- DiabloD3 15y agoExcept 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 15y agoI 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.jpg https://img.skitch.com/20120120-jx8g6cpj8amdagh6dtfbyjtjbp.j... (screenshot) Re: Keeping up to date git submodule foreach git pull origin master --recurse-submodules
- skwp 15y agoyep, they are proper git submodules, and this way you can specifically control which of them you want to update, and when.
- csexton 15y agoFWIW, I used vundle for quite a while and went back to pathogen because vim's load time was much faster. Perhaps they have improved that. vim --startuptime time.txt
- francoisdevlin 15y agoWell, if we're getting out the tape measure, this is my current inspiration: https://github.com/mutewinter/dot_vim https://github.com/mutewinter/dot_vim
- evmar 15y agoMy 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 15y agoThis 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 15y agoalias vim=pico this is a good approach to vi, as well :P
- lukeschlather 15y agoalias vim=pico alias pico=nano alias nano=emacs
- joshmanders 15y agoalias emacs=vim Recursion++;
- sliverstorm 15y agoIt even represents the spirit of emacs! ;)
- burgerbrain 15y agoI often hear that one should not customize their Vim settings because when they have to use another machine they will be at a disadvantage but I must say that I really cannot understand this attitude. My .vimrc is has a good deal of custom stuff that I rely on during day to day coding, but on occasion when I have to use, say, busybox's 'vi' (which by the way isn't even quite POSIX) I very rarely have any trouble at all. Certainly not enough trouble to negate the productivity gain I see with my .vimrc.
- jdludlow 15y agoRemap 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 15y agoI 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://i.imgur.com/99cNs.png http://pqrs.org/macosx/keyremap4macbook/ http://pqrs.org/macosx/keyremap4macbook/
- kmm 15y agoI remapped Caps Lock to Escape too and it interestingly one of the best hacks I ever did. On my keyboard at least, Esc is far away from the home row, and the smallest button on my keyboard (1x1.6 cm^2). Caps Lock is the fourth largest button (1.8x3.2 cm^2) and is only a small distance to the left. I can easily reach Ctrl with my pinky, but not Esc. It's also useful outside of Vim, in almost any application Esc means "Cancel the current operation". The only disadvantage I see is that I'm constantly toggling Caps Lock on other PC's.
- mgrouchy 15y agoI have "jj" mapped to esc, caps-lock remapped to Ctrl. jj only an issue if you are tying things like jj.Reddick or jj abrams :)
- jh3 15y agoI'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.
- oacgnol 15y agoTo 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 15y agoI 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.
- deleted 15y ago[deleted]
- njharman 15y agoThis is an example of poor refactoring. Also, "cleanest" is not better.
- daniellockard 15y agoI 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 https://github.com/daniellockard/vimrc