Live data from Hacker News

A Good Vimrc (2014)

dougblack.io

41–50 of 56 posts

Re: A Good Vimrc (2014)

#41
The literal worst of vimrc is the _default_ settings of many Linux distributions these days. Colors are fine, but _behavior_-changing stuff is not. I would be happier if package installers included a brief configurator as part of installation.

Do you want to use tabs when you press tab, or spaces? If spaces, then _how many_?

Do you want to automatically (infuriatingly IMO) continue comments and completely wreck the ability to paste text without also _telling_ vim that you intend to paste via the `set paste` command?

Simple stuff like that, you know?

Re: A Good Vimrc (2014)

#42
I've been using VIM for a while, and I'm always delighted to read articles or examples of good .vimrc's, but this one tops them all, because of the perfect balance of cool features and concise explanations. Good job, OP, what a wonderful blog post, I learned a couple nice things too!

Re: A Good Vimrc (2014)

#43

The literal worst of vimrc is the _default_ settings of many Linux distributions these days. Colors are fine, but _behavior_-changing stuff is not. I would be happier if package installers included a brief configurator as part of installation. Do you want to use tabs when you press tab, or spaces? If spaces, then _how many_? Do you want to automatically (infuriatingly IMO) continue comments and completely wreck the a…

Ahhh good old 'set paste'. The setting that has turned away so many. When I watch a novice coworker struggle with vim, the breaking point usually comes when they try to paste directly into insert node. That may be the most valuable of all commands in this discussion.

Re: A Good Vimrc (2014)

#44
post #30

I don't believe it's possible to have a good vimrc without really grasping some elementary concepts like movements, operators, registers, windows etc. I have recently watched all the Drew Neil's VimCasts[1] and after just a couple of hours I've realized I was missing a lot for at least 10 years. There is also quite a good presentation on YouTube by Max Cantor "How to Do 90% of What Plugins Do (With Just Vim)"[2]. Ins…

+1 for the Max Cantor presentation - I mostly use stock vim now because of that video... also you can get a lot of mileage from combining :read with shell commands. I like this approach as it forces me to level up my bash.

Re: A Good Vimrc (2014)

#45
post #7

Good write up. Ive been looking into Now this might sound like heresy but I've been considering moving to emacs lately and using evil mode. The thing that gets me is vim's lack for auto completion for stuff like scala. Has anyone managed to set that up?

Have you considered spacemacs? http://spacemacs.org/ I've been using it for a month or so. It's very easy to set up and configure, and it's built with evil-mode in mind. It also has very good modes for development - I use it for Go and everything including completion and hinting function signatures worked right out of the box once the Go layer was installed (which is one line in your .spacemacs)

My problem with Emacs, I'm a bit of a visual person and Emacs doesn't have tabs. There's all sorts of half baked tab system that don't do what the real thing in Vim does.

And everytime someone I ask about this someone point me to some "superior paradigm". It ain't superior if I don't like it :)

Re: A Good Vimrc (2014)

#46

I wonder why text editor preferences are so personal. I use the same editor and probably 90% of the same config as this guy and was nodding along until I saw he remapped B and E. Horrifying! Those are fundamental motions.

I’m always surprised at the number of people who recommend mapping `,` as their Leader key; it’s almost as useful as its counterpart, `;`. I suspect that such people never learned vanilla Vi and use `f`, `t` and related line movement commands. When I learned Vim, I started with the `vimtutor` tutorial. At the end of the tutorial, it suggests Learning the Vi Editor - by Linda Lamb (O’Reilly) [1] for further reading. I…

"I’m always surprised at the number of people who recommend mapping `,` as their Leader key; it’s almost as useful as its counterpart, `;`. I suspect that such people never learned vanilla Vi and use `f`, `t` and related line movement commands."

I've been using vim for years, but I completely disagree with your statement. I rarely find the "," key useful, so to me it was a no-brainer to switch to using it as the leader. I just have ",;" mapped to the functionality that "," used to do.

I use ";" all the time, but searching backwards just barely comes up. Usually, I'll hit "home" and then repeat my "f" search if I need it.

Re: A Good Vimrc (2014)

#47
post #43

The literal worst of vimrc is the _default_ settings of many Linux distributions these days. Colors are fine, but _behavior_-changing stuff is not. I would be happier if package installers included a brief configurator as part of installation. Do you want to use tabs when you press tab, or spaces? If spaces, then _how many_? Do you want to automatically (infuriatingly IMO) continue comments and completely wreck the a…

Ahhh good old 'set paste'. The setting that has turned away so many. When I watch a novice coworker struggle with vim, the breaking point usually comes when they try to paste directly into insert node. That may be the most valuable of all commands in this discussion.

Does vim 8 still not have bracketed paste by default?

https://cirw.in/blog/bracketed-paste

Re: A Good Vimrc (2014)

#48
post #47
post #43

Earlier quoted context omitted.

Ahhh good old 'set paste'. The setting that has turned away so many. When I watch a novice coworker struggle with vim, the breaking point usually comes when they try to paste directly into insert node. That may be the most valuable of all commands in this discussion.

Does vim 8 still not have bracketed paste by default? https://cirw.in/blog/bracketed-paste

Bracketed paste appears to be a third party plugin. I have no reason to believe it is has been rolled into an official Vim release.

Re: A Good Vimrc (2014)

#49
post #6

> Don't put any lines in your vimrc that you don't understand. Actually true for most human-configurable setting files.

I sort of disagree with this and think one should extend in the opposite direction- to keep sharp, have an RNN generate some plausible config options / shell commands, and append them to the bottom of your vimrc / bashrc on startup. This results in sort of like a 'chaos monkey' of coding, to prepare you for when real emergencies pop up.

Oooh, I really like this idea.

Re: A Good Vimrc (2014)

#50
post #45

Earlier quoted context omitted.

Have you considered spacemacs? http://spacemacs.org/ I've been using it for a month or so. It's very easy to set up and configure, and it's built with evil-mode in mind. It also has very good modes for development - I use it for Go and everything including completion and hinting function signatures worked right out of the box once the Go layer was installed (which is one line in your .spacemacs)

My problem with Emacs, I'm a bit of a visual person and Emacs doesn't have tabs. There's all sorts of half baked tab system that don't do what the real thing in Vim does. And everytime someone I ask about this someone point me to some "superior paradigm". It ain't superior if I don't like it :)

I think I have got tabs allright in my emacs, although a tab-layer would be definitely appreciated in spacemacs
Post reply on HN