Live data from Hacker News

A Good Vimrc

dougblack.io

101–110 of 178 posts

Re: A Good Vimrc

#101
post #71

Earlier quoted context omitted.

You may personally be more efficient but as a team or class our overall efficiency drops by being different. Now I'd argue that the class is more important than you personally. We can agree that it matters a lot less what your own personal setup is as long as it saving stuff in the same format but I wouldn't say it doesn't matter at all. As soon as someone asks you for a bit of help you're going to be slowed down by…

>> but as a team or class our overall efficiency drops by being different. Wait, what? How does this follow? In my whole professional career I don't think I've ever sat down at another persons machine, so I don't see how Bob using vim/querty and me using emacs/dvorak could possibly impact our aggregate performance as a team. Do teams really spend a chunk of time fiddling around on each other's computers?

Maybe you have a career that's different from mine. I've spent time upskilling, pairing and mentoring. It's helpful to sit next to these people and show them something and as I said I can teach a junior how to profile on my tricked out vim setup, but helping them do it if we're both using intellij will be less effort in my opinion.

Honestly though, I often work with developers (I'm a contractor so I work with tons of people ) who use GUIs for git or vagrant and the like. If you sit down next to me with your windows system using a gui for some development tool asking me questions about why it doesn't work, I'm going to struggle to help you.

Re: A Good Vimrc

#102
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…

You may wish to look into xcape. Currently i have capslock = escape when pressed alone, or control when pressed with another key. [0] https://github.com/alols/xcape

Re: A Good Vimrc

#103
I just realized something - my vimrc is 12 years old (carried on from my college). It has all my quirks and shortcuts that doesnt make sense to anyone but me. Every now and then, I pick up sone cool stuff from other vimrc and it becomes part of my own.

What I just realized is that my Dockerfile is becoming something like that. Everything from the way the file system is laid out to the supervisord config is something that has become familiar. I do my development in it and its already a year old. All my various production servers use the same base Dockerfile (it includes Ruby, Python, Nginx, Openssl, Golang and Java!).

Re: A Good Vimrc

#104
post #70

Earlier quoted context omitted.

You may personally be more efficient but as a team or class our overall efficiency drops by being different. Now I'd argue that the class is more important than you personally. We can agree that it matters a lot less what your own personal setup is as long as it saving stuff in the same format but I wouldn't say it doesn't matter at all. As soon as someone asks you for a bit of help you're going to be slowed down by…

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.

Re: A Good Vimrc

#105
post #68

Earlier quoted context omitted.

> that can't be explained by anything except by a desire to be treated like a princess Do you mean a desire to be more efficient? Am I some kind of princess because I decided to use a different keyboard layout than the default? That I decided to learn a different language than the one I was told to learn in school? That I wanted to install a different operating system than the one that came with my computer? Your com…

Realistically, what justification is there any more for working on somebody else's machine, being force to use their config? Ok, if your machine explodes and you need their's for a bit fine. But in the long run, the amount of times where you need to actually edit some code by typing on another person's machine should be vanishingly small. I'm all for standards when it comes to collaborating on code. But when it comes…

This, I don't want anyone else's disgusting unwashed hands on my keyboard or mouse. I work with a guy who regularly walks out of a bathroom stall and back to his desk, bypassing the sink entirely. He tried taking over my machine, I was like hell no. So I get a rep for ocd germaphobe, big deal.

Re: A Good Vimrc

#106
post #99
post #84

Earlier quoted context omitted.

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?

In my tests it's always made quite a difference if your fingers are already on the keyboard, and you want to invoke some specific, non-interactive function; you can usually hit the shortcut, whatever it is, in less than the time it takes to move to the mouse alone. Few would argue that moving from keyboard to mouse and back between every keypress would be more efficient than just typing one key after the other, as is…

Interestingly I've also played an unfathmoly amount of FPS games to the point where my mouse skills are pretty fricking nifty, so I may be bias, but I'd question why I have both hands on the keyboard when trying to read and understand code anyways?

The thing is, I'm not arguing that you're not quicker anyways. Just that the speed difference between someone good with a mouse and someone good with keyboard shortcuts generally don't matter in a world where IDEs exist and where understanding code properly takes longer than just navigating through it.

Anyways, I'm not actually bothered what you use as long as you can take care of yourself, which a user with a weird vim configuration generally can. However, as I said in a post above, if you're struggling to use git, I'm only gonna be able to help if you use the cli. That won't be the vim guy, but it will be the windows guy who asked me for ftp access.

Point is though, I think the counter argument that using the same tools is super valid. I don't think it's the most important thing in the world, but I do think it has merit.

Re: A Good Vimrc

#107
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…

I've tried remapping Caps Lock, but I find that the stretch to hit that key eventually irritates my ulnar nerve. I'll stick with "jk" (or "ii" on Colemak).

Re: A Good Vimrc

#108
post #83

Earlier quoted context omitted.

> that can't be explained by anything except by a desire to be treated like a princess Do you mean a desire to be more efficient? Am I some kind of princess because I decided to use a different keyboard layout than the default? That I decided to learn a different language than the one I was told to learn in school? That I wanted to install a different operating system than the one that came with my computer? Your com…

> Am I some kind of princess because I decided to use a different keyboard layout than the default? Maybe you just bought into some myth: https://www.utdallas.edu/~liebowit/keys1.html

I made my own layout because Azerty is unusable for programming; hitting three keys to produce an @ sign or a {} is inexcusable. And, since I play a lot of games, I wanted the default qwerty wasd keys.

But sure, I bought into some typing speed myth, whatever floats your boat. XKCD774.

https://github.com/jleclanche/dotfiles/blob/master/X11/xkb/s...

Re: A Good Vimrc

#109

what is the benefit of representing tabs by 4 spaces?

one argument for spaces > tabs is that with tabs you cannot see if you have (mistakenly) added spaces to indent a particular line (without :set list which can be annoying to some). If someone else opens the file and their tabstop setting was set to a different number than you, they'll see different indentation on those lines. If everyone uses spaces, everyone will always see the same thing.

I think tabs settings as something that should be agreed on by a team or project lead - too easy to screw things up. Same with line ending settings in version control if you're working with a mixed OS team.

Re: A Good Vimrc

#110
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…

I use jk, and agree that binding escape to something easy is the most impactful change on my vim workflow.

I encourage everyone to try it. The amount of times in the last year where i've had to actually type the string "jk" is exactly...one? I think, though perhaps I was imagining even that one. I suppose it really doesn't matter what you bind it to as long as you can execute the escape whilst keeping ALL of your fingers on that good ol' home row.

I guess I should also note that I never use vim except in my own environment where i know i have my own vimrc. I totally get why people who are always using remote computers without their vimrc would want to keep default key bindings and thus be forced to use ctrl-[.

Post reply on HN