10 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)
- 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
- 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
- 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.
- 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.
- 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++;
- 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.
- 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 :)
- cpeterso 15y agoI remapped space to colon (so I can enter commands without shifting for colon). :)
- weaksauce 15y agowell nnoremap ; : is a good way to do that and keep space open for other things unless you use ; for something more useful.
- r00k 15y agoI'd recommend not mapping over ; It's very useful. It repeats your last f or F command. I probably use it a dozen times a day. If you do map something on top of it, consider moving it elsewhere.
- weaksauce 15y agoThat's actually quite useful... I was working off a modified vimrc that had this remap on it and got used to it. Maybe leader f to redo? Though I haven't checked if that is taken by something else. Thanks for the tip.
- 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/
- 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