Live data from Hacker News

A Good Vimrc

dougblack.io

51–60 of 178 posts

Re: A Good Vimrc

#51

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…

If there is only one thing I can complain about vim/vi, it's the esc key. The key is too far away to reach easily. It is most accessible with the little finger, which is our weakness finger. Coupled with the fact that it's likely the most important key in vim. I hate it.

So when I use a non-configured vim, it's the thing that I miss the most. The rest is trivial.

However, using someone else vim is completely different!

You must keep in mind that vim is much similar to a programming language. You can remap keys all over the place. You can create exotic combinations that do wonderful and/or terrible things with few key strokes. You can install plugins that argument and alter vim behaviours.

Jumping into a well tuned vim setup is not unsimilar to starting to use a new programming framework. It's hard to be productive right away.

In that case usually, I just rename .vimrc, remap , do my things and get out of the way.

Re: A Good Vimrc

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

* Regarding 'princess' dig, please see: http://www.thedailybeast.com/articles/2014/05/27/your-prince...

Re: A Good Vimrc

#53
Good tutorial. Looking forward to combing over my vimrc tomorrow when I have some time. It's similarly copied from somebody else's many moons ago, and there are things that it does that I don't really like but haven't been bothered to change (eg. sometimes I want 2 space indents instead of 4).

Re: A Good Vimrc

#54

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…

[deleted]

Re: A Good Vimrc

#55

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…

The defaults are just fine. (As a sysadmin) I tend to work on systems that mostly aren't my own workstation and have never found it to be an issue (can't be arsed to push out my own config everywhere, not to mention other admins may not like what I like). I imagine it might be different for a coder...line numbers and pretty colors are nice I guess?

Re: A Good Vimrc

#56
post #20

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…

The default vim config is pretty barebones. Actually, one of the main goals of Neovim[1] is to provide better defaults[2], such has syntax highlighting. [1] https://neovim.io/ [2] https://github.com/neovim/neovim/issues/276

Holy ish! Neovim has progressed so much. Exciting.

Re: A Good Vimrc

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

> [...] especially because you can't type it anymore without waiting

This was my thought when I saw this mapping for the first time, and when I started customizing my vimrc I opted for using caps lock as well. It didn´t take long for me to change that and start using kj instead -- in the end it was more common for me to type constants in all-caps than typing "Reykjavik."

Re: A Good Vimrc

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

Ack, no. Bind caps lock to Ctrl, and escape is now the trivial chord C-[.

As an added benefit, getting used to this layout will help you out with migrating out of vim to emacs.

Re: A Good Vimrc

#59
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 'jf' instead of 'jk', so I can type "Dijkstra" occasionally, not to mention they're both on the home row, under your index fingers, typically have physical nubs on the keys, and no words in any language I can find contain the letters 'jf'.

Re: A Good Vimrc

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

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

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 understanding each other system. If we conformed, teaching a junior how to profile code will be easier than showing him how to do it with your vim setup, for example.

Finally I'm never going to buy the efficiency of keyboard shortcuts when coding is generally worth the time sink in learning them over clicking a mouse in an IDE. Sure, they will make you faster, but I'd rather most people took longer and delivered solutions that weren't actually worse than the problem. All too often the quick people land me with stuff that pisses me off.

Post reply on HN