Live data from Hacker News

A Good Vimrc (2014)

dougblack.io

51–56 of 56 posts

Re: A Good Vimrc (2014)

#51

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…

Tabs vs spaces should be a per-project setting, not per-user setting. For that: http://editorconfig.org/ (there's a vim plugin: https://github.com/editorconfig/editorconfig-vim)

Re: A Good Vimrc (2014)

#52

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 use `,` as Leader, as well as to search back if I happen to `;` over something I was looking for. I don't mind waiting 400ms (my `timeoutlen`).

Re: A Good Vimrc (2014)

#53

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 agree that we shouldn't use "," or ";". I prefer to use SPACE as the leader key, as it is probably the most prominent key and also easiest to reach, but I can understand why some would use "," or ";" because of it's easy reachability and the fact that those keys aren't as used as often (at least for novice users). Perhaps it should be part of "best practice" in Vim.

Re: A Good Vimrc (2014)

#54

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 was listening to a recent TalkPython podcast with Dougal Matthews titled "Effective Code Reviews". Host Kennedy asks every interviewee what is their favorite editor. Dougal's answer: (44:35-44:48) "I use Vim all the time. Yeah, I work in so many remote servers and VMs that I have some scripts to kind of set up my Vim environment on that machine, and then it's just great." Who knew it would be that easy to switch to…

It is easy once you have put in the hours (days? months?) learning what you need and then scripting the setup... :)

Re: A Good Vimrc (2014)

#55
post #46

Earlier quoted context omitted.

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

Thanks for different perspective (and to otterpro and tasuki). I use `;` much more often than `,` but I still find the `,` useful when I’ve gone past the position I want to go to, e.g., typing `5fx` when I should really have have used `4fx`.

Re: A Good Vimrc (2014)

#56
post #3

Now just add the section about uploading it to your GitHub so all new servers get setup with a simple git clone, and any new changes can be propogated around with push/pull.

For anyone interested in this topic, [0] contains the best setup I've found for storing dotfiles in a git repo, then linking them with GNU Stow. Steps are just: git clone https://github.com/me/my-dotfile-repo cd my-dotfile-repo stow --target=$HOME zsh stow --target=$HOME vim ... Elegant, cross-platform, easy to remember. [0]: http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to...

Wow, this is fantastic. I just repo'd all my dot files and used Stow to set them up. Very elegant indeed! Thank you!
Post reply on HN