views:

598

answers:

7

I've used VIM for many years as my primary text editor. And I am still learning how to use VIM for various editing tasks.

The problem is that even if I learn something and use it once a week I forgot soon how I did it -- classic case is search and replace in many buffers using bufdo :(.

I was wondering if there is any kata to daily VIM practice including many VIM commands:

  • open existing files,
  • create new files,
  • edit files and move around:
    • move cursor (beginning & end of line/function/block/screen, top & bottom of screen, move screen line up/down, etc.),
    • mark, copy & paste,
    • insert & remove characters/words/lines,
    • move between buffers,
    • move between windows,
    • arrange windows,
    • search & replace,
    • repeat last command,
    • formatting (=),
    • probably some more (bookmarks, macros).
  • save files,
  • create/update/save an open projects (mksession and source).

Do you know any kata for VIM of tutorial which could help to practice all above (and more) VIM commands?

Added on 7th April

I've already used VIM Quick Reference Card, but it's annoying that I have to stop coding in the middle of flow to check how can I split the window/move between windows/search and replace in all buffers or move screen a line up (^E) -- examples from last few weeks.

A: 

You mean something like vimtutor?

Ed Guiness
I assume he wants something *like* it, but significantly more advanced, vimtutor doesn't cover much.
Chad Birch
Exactly. VIMTutor does not cover a lot of options (buffers/windows, etc.) :(.
Grzegorz Gierlik
+1  A: 

A kata exercise would be really cool but also rather time consuming. I try learning new VIM stuff by practicing the new things I learn as much as possible in the time that follows learning them. If you're tired or your memory is tricky then you can use some helper like a post-it near your display with the newly learned commands. Often some stuff you use less may end up being forgotten, such as :cd %:h or maybe the famous :!sudo tee %, but hey, if you don't use it that much, then maybe a kata with it won't be that useful...

Miguel Ventura
A: 

Make your own Vim cheat sheet with the useful commands that you tend to forget and grow it over time. The kata idea is nice, but do you really want to become a Vim master or do you want to edit effectively? The things you use daily you have (mostly) already mastered. It's the things you need weekly or monthly that don't stick.

Various people have posted their own Vim cheat sheets and I've noticed that they are all quite different. Needs differ, and Vim is a rich environment. You should make your own.

dwc
Good point -- I will think about my own cheat sheet (and make it easy to read).
Grzegorz Gierlik
+2  A: 

This is a nice idea! I think you could come up with a series of Vim katas, each designed to teach a different set of commands.

Here's a candidate for a Vim kata: creating the Vimcasts.org logo as ASCII art, from one of my screencasts. It covers a few topics: macros, duplicating a line, substituting every character in a visual selection with one character, search and replace within a visual selection. You can get the before and after source file here to practice with.

_____________________________________________________________________
____/\\\________/\\\___/\\\\\\\\\\\___/\\\\____________/\\\\__________
____\/\\\_______\/\\\__\/////\\\///___\/\\\\\\________/\\\\\\__________
_____\//\\\______/\\\_______\/\\\______\/\\\//\\\____/\\\//\\\__________
_______\//\\\____/\\\________\/\\\______\/\\\\///\\\/\\\/_\/\\\__________
_________\//\\\__/\\\_________\/\\\______\/\\\__\///\\\/___\/\\\__________
___________\//\\\/\\\__________\/\\\______\/\\\____\///_____\/\\\__________
_____________\//\\\\\___________\/\\\______\/\\\_____________\/\\\__________
_______________\//\\\_________/\\\\\\\\\\\__\/\\\_____________\/\\\__________
_________________\///_________\///////////___\///______________\///___________
_______________________________________________________________________________


______________________________________________________________________________________________________________
___________________/\\\\\\\\\______/\\\\\\\\\_________/\\\\\\\\\\\_____/\\\\\\\\\\\\\\\______/\\\\\\\\\\\______
_________________/\\\////////_____/\\\\\\\\\\\\\_____/\\\/////////\\\__\///////\\\/////_____/\\\/////////\\\____
________________/\\\/_____________/\\\/////////\\\___\//\\\______\///_________\/\\\_________\//\\\______\///_____                                        /\\\\\\\\
________________/\\\______________\/\\\_______\/\\\____\////\\\________________\/\\\__________\////\\\____________            /\\\\\      /\\/\\\\\\\    /\\\////\\\
________________\/\\\______________\/\\\\\\\\\\\\\\\_______\////\\\_____________\/\\\_____________\////\\\_________          /\\\///\\\   \/\\\/////\\\  \//\\\\\\\\\
_________________\//\\\_____________\/\\\/////////\\\__________\////\\\__________\/\\\________________\////\\\______         /\\\  \//\\\  \/\\\   \///    \///////\\\
___________________\///\\\___________\/\\\_______\/\\\___/\\\______\//\\\_________\/\\\_________/\\\______\//\\\_____        \//\\\  /\\\   \/\\\           /\\     \\\
______________________\////\\\\\\\\\__\/\\\_______\/\\\__\///\\\\\\\\\\\/__________\/\\\________\///\\\\\\\\\\\/______  /\\\   \///\\\\\/    \/\\\          \//\\\\\\\\
__________________________\/////////___\///________\///_____\///////////____________\///___________\///////////________ \///      \/////      \///            \////////
________________________________________________________________________________________________________________________
nelstrom
A: 

I recently asked a very similar question on the Vim mailing list. So far the responses have generally been "No, and you don't need that" but perhaps something more fruitful will come up:

http://groups.google.com/group/vim_use/browse_thread/thread/fc309c476334659e

Duane J
+5  A: 

Rob Conery just put one up http://blog.wekeroad.com/2010/05/24/vim-kata-one

SheepPond
And there are some more (i.e. [Vim Kata Number One](http://blog.wekeroad.com/2010/05/24/vim-kata-one)) in comments to Rob's post :).
Grzegorz Gierlik
A: 

In comments to Vim Kata Number One (linked here by SheepPond) I've found also VimKata project on Git.

Grzegorz Gierlik