Live data from Hacker News

A Good Vimrc

dougblack.io

111–120 of 178 posts

Re: A Good Vimrc

#111
post #85
post #49

Rebinding jk to escape because escape is too far away seemed like a fairly ugly hack to me, especially because you can't type it anymore without waiting. Why not simply rebind caps lock to escape? Caps lock is used awfully little, considering how prominent its position on the keyboard is. On Linux, you can rebind it by adding setxkbmap -option caps:escape to your .profile. If instead of an additional escape you prefe…

Instead of remapping keys, I've always used Ctrl-[ for escape.

Same here, and I don't even understand why people want to remap Ctrl to Caps (but I never used Mac, so I don't know: maybe it is inconvenient on their keyboards). And recommendation to remap "jk" to Esc always almost made me ignore the whole post, because being able to enter any letter sequence I want is the very least I would expect from a goddamn text editor.

Re: A Good Vimrc

#112
post #96

Earlier quoted context omitted.

Hi! Author here. Fair points. I'm gonna start out on the defensive: I didn't post the article, which kinda stinks because if I knew it was going to get such attention I would have updated it to my current setup. Anyways as the 1.5 year old article states: This article will almost certainly fall out of date with my vimrc in the very near future I don't do jk escape anymore. I have since abandoned custom escapes becaus…

ctrl+] will act as escape in any vim out there. At least that I've encountered. Having caps as ctrl makes it really easy to hit.

ctr+[ you mean.

Re: A Good Vimrc

#113
post #49

Rebinding jk to escape because escape is too far away seemed like a fairly ugly hack to me, especially because you can't type it anymore without waiting. Why not simply rebind caps lock to escape? Caps lock is used awfully little, considering how prominent its position on the keyboard is. On Linux, you can rebind it by adding setxkbmap -option caps:escape to your .profile. If instead of an additional escape you prefe…

Hi! Author here. Fair points. I'm gonna start out on the defensive: I didn't post the article, which kinda stinks because if I knew it was going to get such attention I would have updated it to my current setup. Anyways as the 1.5 year old article states: This article will almost certainly fall out of date with my vimrc in the very near future I don't do jk escape anymore. I have since abandoned custom escapes becaus…

Do you think that updating your article would make more sense now. It would benefit users who read it now.

Re: A Good Vimrc

#114
post #84
post #70

Earlier quoted context omitted.

It isn't just writing code faster, but also navigating (thus comprehending) faster, and in some cases writing code with less errors.

Has this "faster" thing been measured and profiled scientifically in some kind of A/B testing? Or it's just based on subjective feelings and cargo cult?

This whole discussion is ridiculous. When you customize your vim key bindings, you do so either on your machine, or your profile on some remote server. One does not mess with other's computers or settings. But ...

> Or it's based on subjective feelings and cargo cult?

What if it is? What if I am _factually_ not "more efficient", what if I am just "happier" with _my_ setup on _my computer_? how does that in reality could have a negative effect on a team? I am of course assuming that the "we mess around with other's machines or profiles" is an obvious-enough bad practice that it doesn't happen. Right? Right!?

Re: A Good Vimrc

#115
post #70

Earlier quoted context omitted.

It isn't just writing code faster, but also navigating (thus comprehending) faster, and in some cases writing code with less errors.

Faster than what? Faster than clicking on the function name and seeing where it's reference in an IDE? Like I said, I dont buy that your vim plugins and shortcuts are going to help you understand that code better. I'm in no way arguing we should all be using notepad though.

This isn't an argument about "vim" vs "IDEs". You really should read the entire thread.. or re-read it.

Re: A Good Vimrc

#118
post #64

Earlier quoted context omitted.

What about IKEA names?

Did you know that IKEA names tend to be names of towns and places in Sweden/Norway? So if IKEA names have jf then Swedish/Norwegian must have that letter combo as well..

IKEA also frequently use first names (for people), e.g. Billy or Erik, and even abstract words, e.g. Poäng (point, as in "that's a good point".).

As for jf: I searched through the pdf of a 1300 page Norwegian dictionary, and the single word in there containing jf is the abbreviation "jfr." which is the same as the abbreviation "cf." (confer) in English. So jf appears to be a very good choice.

Re: A Good Vimrc

#119
post #31
post #10

This is a very nice write up, but the tabs/spaces part of it makes no sense at all. "I like it, since it means my source code looks the same on every machine." That reason just makes no sense at all. There's only one reason for configuring tabs to be anything but tabs, and that's because someone else set the standard. So if you're editing python or bash, and you don't feel like being a rebel with a cause, you set exp…

Why would either tabs or spaces be better than the other? Isn't that one of those pedantic style debates that often come down to a matter of personal preference? I'd get rather annoyed if someone on my team was constantly changing the indentation from tabs to spaces or vice versa every time they opened a file. To elaborate on the author's reasoning for using spaces, people sometimes mix spaces with tabs in the indent…

As an example of where it's not just personal preference: makefiles require actual tabs, not spaces, in the indentation in recipes for targets. And in Python, mixing tabs and spaces will cause flow control to do something different than what you intend it to. In vim you can handle tabs on a per-filetype basis, eg. I have red syntax highlighting of spaces for indentation in makefiles.

Re: A Good Vimrc

#120
post #49

Rebinding jk to escape because escape is too far away seemed like a fairly ugly hack to me, especially because you can't type it anymore without waiting. Why not simply rebind caps lock to escape? Caps lock is used awfully little, considering how prominent its position on the keyboard is. On Linux, you can rebind it by adding setxkbmap -option caps:escape to your .profile. If instead of an additional escape you prefe…

Capslock is already in use as my Compose key.
Post reply on HN