5

Being a common tool for *nix System Administrators, I'm looking for recommendations for vi/vim tutorials. After seeing this 'how do I do [this] in vim' question in Stack Overflow, I realize that I have yet to find a helpful-to-beginners tutorial which teaches not only the basic commands, but also ties in the logical mindset of vim (no snickering, emacs users). I have seen plenty of cheat-sheets (with varying levels of helpfulness), but they never tie in how to modify commands.

An example is that I know that to delete a line you use dd, but to delete a set number of lines use (three in this example), use d3d.

Another is that if you want a new line (to push the current line down) use a capital O, but to insert a line after this line, use lowercase o. (I think of it as the smaller, meeker version is more polite, while the big one shoves other lines out of it's way.)

Tying those together, to copy a line, use yy, and p where you want to paste. If you want to copy multiple lines (say 7), do y7y. Capital P to shove the current line down, or lowercase p to paste after the current line.

What are some 'tying it all together' tutorials?

3
  • I'm surprised that this is being marked off-topic. Especially as vim is available on almost every platform (aside from Cisco, perhaps) which SysAds may be needed. Would it be better served on another site or as a wiki?
    – gWaldo
    Oct 12, 2011 at 13:39
  • 1
    (or are the close votes coming from emacs lovers?)
    – gWaldo
    Oct 12, 2011 at 13:41
  • I'm surprised that someone with 4k rep would consider it on topic in serverfault.
    – user35787
    Oct 12, 2011 at 13:45

8 Answers 8

6

I am working on an interactive tutorial for basic commands. You can find it at: http://www.openvim.com There is already a sandbox page that has a context sensitive menu, so that if you press '5' you can see what possibilities you have after that, e.g. 5w.

There will be new concept, a teaching box, later on, which deals with the wholesome experience of Vim; i.e. opening of files, splitting windows, etc.

Most of the basic functionality is there already. Currently I'm adding visual and visual block modes.

And hopefully I have energy to add some Vim based games.

2
  • That sounds awesome, but you're not the first persons to mention it, but I personally would be thrilled about that! Thanks for working on that!
    – gWaldo
    Oct 12, 2011 at 13:16
  • @gWaldo You're welcome! I am happy to hear people find it useful :)
    – egaga
    Oct 12, 2011 at 13:27
8

Run vimtutor. It's a great tutorial that will give you just the right amount of knowledge necessary to get started with vim.

4

You can also try the command 'vimtutor' for a tutorial. I came across this recently which seems neat: Interactive VIM tutorial

3

Typing ":help" in vi(m) will open up quite a world of information for you. Also, you may want to check out this tutorial: http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/

1
  • That does look like an excellent tutorial. Thanks!
    – gWaldo
    Oct 12, 2011 at 13:38
3

If you prefer dead tree materials, O'Reilly is hard to beat.

1
  • Ha! I forgot about that!
    – gWaldo
    Oct 12, 2011 at 14:15
2

Derek Wyatt has a series of tutorial videos that I've found quite helpful. They cover basic stuff through fairly advanced, and are in short manageable portions.

1

It probably depends on what kind of learner you are but I don't think OpenVim is more useful than simply running $ vimtutor : it's longer, less exhaustive and too gimmicky. Plus it's a very poor and limited Vim emulation. Use the real vim instead.

From your question I gather that you already know the basics, anyway. Openvim is very basic so you won't learn many things from it.

The next step after vimtutor is to exercise on real text and real code with real vim.

That's when you'll notice by yourself that everything is tied together: using vim is speaking a language with a rich vocabulary and a very simple set of grammar rules (with their exceptions).

0

to be honest, i'd advise learning the commands when you find you need them. Everyone works in different ways, and you shouldnt really allow a tutorial to give you one mind set.

I say edit how you want, and look into commands with a view to making that way easier. For example, i do a fair bit of python coding, so to me code folding and indentation is key, for others searching is more important so they focus on those commands.

1
  • That is what I have been doing, but I'm looking for the 'tie it all together' bit.
    – gWaldo
    Oct 17, 2011 at 21:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .