Live data from Hacker News

Ask HN: What's the best way to get started with Vi(m)

news.ycombinator.com

1–10 of 42 posts

Re: Ask HN: What's the best way to get started with Vi(m)

#3
Assuming you're on Mac you'll need to set up a decent .vimrc to enable syntax highlighting, indentation and some other bits. Vim is a different beast depending on how it's set up.

The built in tutorial is a decent place to start. I think that's the only thing I did apart from editing code. It takes a while to get over the hump but it's worth it.

I also suggest remapping your CAPS LOCK key to ESC. PCKeyboard Hack is free and simple to set up for that purpose. I've never liked the role of ESC in vi. It's too far away from the home keys.

If you learn to love the efficiency, I'd suggest looking at Komodo Edit or another editor that has vim key mappings. I prefer Komodo because it's vim plus code completion (I'm not aware of a vim solution for that) and a bunch of other bits that will save time.

Re: Ask HN: What's the best way to get started with Vi(m)

#6
I think with something like Vim it's best to get a grasp on the very basics (saving/opening documents, moving into and out of insert mode, navigating with hjkl) and then add one of two things at a time as you get comfortable with those. If you try to do everything at once you just end up getting overwhelmed.

I didn't really start to like Vim until I started playing around with my .vimrc file. There were too many minor irritants and things I wanted changed. An Ask HN on the subject came in very handy: http://news.ycombinator.com/item?id=856051

Mine (along with a few other minor customizations) is at http://github.com/samdk/vimconf/blob/master/dotvimrc if you'd like to take a look.

Some other good resources: http://dotfiles.org/.vimrc http://www.vi-improved.org/vimrc.php

Re: Ask HN: What's the best way to get started with Vi(m)

#8

Type this into your terminal: emacs

Do people ever get into serious arguments about using one or the other? At work we jokingly take jabs at the other camp, but that's more making fun of the fact that it's been such a hyped up feud.

Re: Ask HN: What's the best way to get started with Vi(m)

#9
This is the cheat sheet that I used to get started: http://home.uchicago.edu/~gan/file/vim.pdf

Learn the basics first:

1. Basic movement (h l k j)

2. Insertion mode (i), deletion (x), selections/visual Mode (v), copying/yank (y), pasting/put (p), and exit insertion mode (esc)

Once you learn those the rest is pretty easy to pick up.

I should warn you though, once you get used to the key commands it's hard to go back to another editor.

Post reply on HN