4 ms·
The greatest dev timesaving tip that someone gave me was to clear my .vimrc and start off with a blank slate. vim is a language in itself [1] and it's easy to t
by madmax108 10y ago
The greatest dev timesaving tip that someone gave me was to clear my .vimrc and start off with a blank slate. vim is a language in itself [1] and it's easy to try to mimic someone who has conversational fluency in it, but as with languages, the only way to learn in practice from the start. Projects like SpaceVim try to create an IDE like environment, but because of being terminal driven, it's difficult for anyone to "discover" features. You end up with a large distribution with barely used features. Instead by growing and maintaining your own vimrc, you get something that can be both used everywhere (dotfiles and Github FTW) and work FOR you. At the end of the day, vim is JUST another tool to make you work more efficiently.
Trust me. "truncate -s 0 ~/.vimrc" and take the time to learn. You won't regret it in the long run.
[1] https://news.ycombinator.com/item?id=10315645 https://news.ycombinator.com/item?id=10315645
- shmerl 10y agotruncate -s 0 ~/.vimrc Shorter way: > ~/.vimrc
- bigbugbag 10y agoNot really shorter as I have to Ctrl+C to get back to shell afterwards. Anyways my zsh has noclobber set so your command fails with error: zsh: file exists: ~/.vimrc
- stplsd 10y ago> ~/.vimrc works on bash, but it hangs on zsh because it treats it like cat > ~/.vimrc (> without any command in front of it is not well defined in POSIX) So portable way to do this is like this: :> ~/.vimrc
- stplsd 10y agoOr to be completely portable :> ~/.vimrc
- dotancohen 10y agoSmarter way: $ mv ~/.vimrc ~/vimrc-reference
- shmerl 10y agoI'm trying to avoid cluttering $HOME. In my case it's ~/.config/nvim/init.vim
- smallnamespace 10y agoI don't quite understand this point. Why does the exact starting point of tinkering (existing .vimrc vs a completely blank one) matter, unless you somehow think the empty .vimrc defaults are the most sensible? Like, there could be a bunch of features that are barely used and not discovered, but seems like the easiest way to discover new features is to scan through a good .vimrc, rather than sleuthing through online resources.
- adrusi 10y agoStarting with a blank slate lets you refer to just the program's documentation to configure it, while if you start with a config bundle you'll have to refer to both the program's documentation and the bundle's documentation, and you'll have to be decently familiar with both how the program works and what the bundle does in order to make creative customizations. Using a configuration bundle makes the learning curve less steep but more tall, essentially.
- kevinjcliao 10y agoHave you really saved time, though? I know next to nothing about elisp, yet I can be perfectly productive with Spacemacs. Being able to edit my .spacemacs file and add a functional layer for an entirely new programming language with sane defaults seriously beats fighting configuration files to do the same thing anyways. This sort of 'configure your own' extremist software purity movement is great for some people, but if you want a setup that meets your needs 95% of the time, and works well, Spacemacs is great. I'm sure learning to configure your own vimrc has been a rewarding experience, but I don't think you can really argue it's a time saving measure.
- jsmeaton 10y agoWhen I forked my dotfiles project I took the time to learn what most of the changes, commands, and config did. I removed a lot that I didn't find relevant. But I don't think I'd have gotten near to the current state if I'd started from scratch. I think there's value in learning what prepackaged configs provide and tailoring them. I don't necessarily agree that starting from scratch is optimum for most though.
- joefreeman 10y agoI discovered recently that the default install of vim on Ubuntu (and I guess Debian in general) includes some customised configuration (/usr/share/vim/vim74/debian.vim), which makes it a bit harder to grasp what's going on.
- wyclif 10y agoJust about the first thing I do after installing Ubuntu is apt-get install vim. But you're right, the default should be vanilla vim config.
- ageofwant 10y agoI've seen this sentiment here and there but I've yet to appreciate it... I've observed co-workers that do this and while they do get very handy with their selected subset of tools, they tend to use far less of the available ecosystem than a promiscuous copy paster, or a framework user, like me. I think its got a lot to do about temperament - some people like more control over less, and find the secret squirrel magic below somewhat sinister. There is no way that I would be able to build spacemacs from scratch, but I do benefit a lot from riding the integrated magic beast, even if it sometimes go into holes no amount of cursing and praying can prevent.
- ageofwant 10y agoI have done this and while 'regret' is going to far, I would have benefit more from doing something more productive with that time.
- yrro 10y agoFYI, Vim 8 ships a defaults.vim that set up some nice defaults for new users, and an empty .vimrc file disables processing of these files. A 'null' .vimrc looks something more like: unlet! skip_defaults_vim source $VIMRUNTIME/defaults.vim See ':help defaults' for more info.