Live data from Hacker News

A Good Vimrc

dougblack.io

31–40 of 178 posts

Re: A Good Vimrc

#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 indentation unknowingly. If you're not using the author's tab size on your machine, the code doesn't format well at all and if you want to convert to spaces you'd have to manually edit a lot of things. There's also the issue with aligning things as well, which spaces are more consistent for as well. At least with spaces you can see the author's original intention and then reformat it as you wish.

Re: A Good Vimrc

#32
post #27

I don't use vim as my go to editor so I may be asking a silly question; does it just use idiotic defaults or something? I've only met a couple 'vim users' who could just hop onto someone else's vim setup and be productive, and I've never met a single vim user who could use someone else's setup without making comments about everything being different. I guess the question is do people modify vim cause they can or caus…

Vim's default are indeed dumb, but what you described is not a vim-specific problem. Walk into any room full of coders and try to use their computers; you'll discover tons of weirdness that can't be explained by anything except by a desire to be treated like a princess.* Things like rebinding basic shortcuts, reversing the scroll direction (Mac users will get this), swapping Cmd/Ctrl, using some obscure shell or even…

Wait, am I missing something obvious here, or are you seriously complaining about people reversing the scroll direction on their own computers?

Re: A Good Vimrc

#33
post #27

Earlier quoted context omitted.

Vim's default are indeed dumb, but what you described is not a vim-specific problem. Walk into any room full of coders and try to use their computers; you'll discover tons of weirdness that can't be explained by anything except by a desire to be treated like a princess.* Things like rebinding basic shortcuts, reversing the scroll direction (Mac users will get this), swapping Cmd/Ctrl, using some obscure shell or even…

Wait, am I missing something obvious here, or are you seriously complaining about people reversing the scroll direction on their own computers?

Apple reverses scrolling by default. I don't know about other coders' computers, but there are people who don't know how to change it, and whenever I boot into recovery mode it gets reversed.

Re: A Good Vimrc

#34

Disabling the search highlight seems like a rather lowly use for leader+space. Great guide though, didn't know about quite a few options in here, wildmenu is great. I switched to vim from subl about a month ago - it took a bit of getting used to but I'm loving it now. I still use subl for some multi cursor wizardry but that's less and less common now. I found the disabling the arrow keys in normal mode was the point…

there are at least one plugin for multiple cursors stuff - https://github.com/terryma/vim-multiple-cursors

Re: A Good Vimrc

#36
post #27

I don't use vim as my go to editor so I may be asking a silly question; does it just use idiotic defaults or something? I've only met a couple 'vim users' who could just hop onto someone else's vim setup and be productive, and I've never met a single vim user who could use someone else's setup without making comments about everything being different. I guess the question is do people modify vim cause they can or caus…

Vim's default are indeed dumb, but what you described is not a vim-specific problem. Walk into any room full of coders and try to use their computers; you'll discover tons of weirdness that can't be explained by anything except by a desire to be treated like a princess.* Things like rebinding basic shortcuts, reversing the scroll direction (Mac users will get this), swapping Cmd/Ctrl, using some obscure shell or even…

"Vim's default are indeed dumb, but what you described is not a vim-specific problem. Walk into any room full of coders and try to use their computers; you'll discover tons of weirdness that can't be explained by anything except by a desire to be treated like a princess."

Yes, shame on those evil coders for wanting to use their own computers in a manner which they find most enjoyable and productive! They must be assimilated! Give me a break.

"Things like rebinding basic shortcuts,"

Again, give me a break. Developers should be allowed to configure their individual machines in any way they wish. Different people work differently.

"reversing the scroll direction (Mac users will get this),"

When you've worked on platforms for decades where the scroll direction works one way, then end up on a platform where it is reversed, what is wrong with changing the new system to work the way you are used to? Yeah, I might decide to get used to the differences, or I might change it because I prefer it the old way, but who cares?

"swapping Cmd/Ctrl,"

again, who cares -- it's their machine.

"using some obscure shell"

I also see no problem with this -- if they prefer it, just let them.

"or even infecting other people's machines with some haphazardly scp'd dotfiles."

This is a legitimate complaint, if the person is leaving stuff behind that screws up the other person's computer. But if the person is expected to work on other peoples machines, then I think a reasonable solution could be worked out. You should try to defer as much as reasonably possible to the person who the machine belongs to. On the other hand, if you are asking someone else to do work on your machine, it seems reasonable to let them copy some dotfiles in order to help them do the work -- as long as they don't affect your stuff.

"This kind of overcustomization is fine if you live in a basement and work on a project alone."

I don't buy the "overcustomization" label. Yes, it is possible to spend too much time customizing things (if, for example, it prevents you from getting your actual work done). However, programmers can make themselves much more efficient by many of these customizations. Different people have different ways of working, and they have different jobs. Vanilla configurations of things like editors are fine, but the ability to customize exists for a reason -- you can make your job easier and yourself more efficient by customizing your tools.

"As soon as you become a part of a team, please stop. You're making cooperation unnecessarily hard and spending company time on an optimization that isn't."

I've worked on many different development teams over the years. At all of those jobs, it was an extremely rare thing to even do development on someone elses computer. Everyone uses their own.

"I sometimes joke that coders who refuse to conform to the industry standards should wear a tiara as an indication they are, indeed, unique snowflakes free from the usual social expectations. It seems to work."

What "industry standards" are you referring to? Is there an ISO standard for vim keybindings? Please. Also, I don't think the whole "Princess" analogy is fair. Just because someone has their own way of working doesn't make them self-absorbed and shallow.

(edited for better formatting)

Re: A Good Vimrc

#37
post #34

Disabling the search highlight seems like a rather lowly use for leader+space. Great guide though, didn't know about quite a few options in here, wildmenu is great. I switched to vim from subl about a month ago - it took a bit of getting used to but I'm loving it now. I still use subl for some multi cursor wizardry but that's less and less common now. I found the disabling the arrow keys in normal mode was the point…

there are at least one plugin for multiple cursors stuff - https://github.com/terryma/vim-multiple-cursors

Yeah - I need to have another look into it. Visual block is working ok for the time being.

Re: A Good Vimrc

#38
post #27

Earlier quoted context omitted.

Vim's default are indeed dumb, but what you described is not a vim-specific problem. Walk into any room full of coders and try to use their computers; you'll discover tons of weirdness that can't be explained by anything except by a desire to be treated like a princess.* Things like rebinding basic shortcuts, reversing the scroll direction (Mac users will get this), swapping Cmd/Ctrl, using some obscure shell or even…

Wait, am I missing something obvious here, or are you seriously complaining about people reversing the scroll direction on their own computers?

I'm actually glad this complaint was made. But only because I was unaware that you could change the scroll direction on a Mac.

I will definitely be making that "overcustomization" on my Mac. :-D

Re: A Good Vimrc

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

You're mixing up arguments. No one on your team should be changing indentations. You should decide as a team what your settings are going to be, that's why I suggest using DetectIndent to make sure your settings match whatever the project guidelines are.

It's not a matter of personal preference though. Tabs are simply superior for encoding indentation. If you use tabs for indentation you can configure their width in your editor to match your personal preference, spaces doesn't allow for that. That's the only significant difference, and the only good reason for using tabs instead of spaces.

None of the arguments you made about spaces make sense. What's the fact that sometimes people mix up tabs and spaces got to do with anything? The whole idea of using tabs is that the code does format well regardless of what tab-width setting you have on your machine. Converting tabs to spaces does not require manual intervention at all. Alignment should be done with spaces, no one is argueing to use tabs for alignment. You can't use tabs for alignment because their width is undefined! The whole idea of using tabs is semantically encoding the authors original intention to allow you to reformat as you wish! At this point.. are you just trolling me?

Re: A Good Vimrc

#40
post #27

I don't use vim as my go to editor so I may be asking a silly question; does it just use idiotic defaults or something? I've only met a couple 'vim users' who could just hop onto someone else's vim setup and be productive, and I've never met a single vim user who could use someone else's setup without making comments about everything being different. I guess the question is do people modify vim cause they can or caus…

Vim's default are indeed dumb, but what you described is not a vim-specific problem. Walk into any room full of coders and try to use their computers; you'll discover tons of weirdness that can't be explained by anything except by a desire to be treated like a princess.* Things like rebinding basic shortcuts, reversing the scroll direction (Mac users will get this), swapping Cmd/Ctrl, using some obscure shell or even…

> 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 comment is not just hostile, it is unbelievably pretentious. You quite clearly don't understand why people customize things. If you want to live in your undecorated, perfectly square single-room house you're welcome to do so without telling others they're not "part of the team" for having different preferences than you do.

Damn...

Post reply on HN