Skip to content

Instantly share code, notes, and snippets.

@adomokos
Last active December 18, 2015 05:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adomokos/5735165 to your computer and use it in GitHub Desktop.
Save adomokos/5735165 to your computer and use it in GitHub Desktop.
vim katas

Selection

  1. type in the word: "errors for job profile"
  2. move to the first 'p'
  3. select the entire content within the quotes: vi"
  4. select just from the cursor to the quotes: vt"
  5. delete just from the cursor location to the quote: dt"
  6. delete everything within the quotes: di"

Creating, using marks

  1. open a file with a few hundred lines of code
  2. view all the marks - :marks
  3. add a mark: ma
  4. jump to that mark: 'a

Move on the screen

  1. Open a screenful of text, where the file is several hundred lines long
  2. Move to the bottom of the screen: L
  3. Move to the middle of the screen: M
  4. Move to the top of the screen: H

Using Surround.vim

  1. Delete quotes from "Hello *World!" by - ds"
  2. Change the square brackets in [123+4*56]/2 to parens by - cs])
  3. Change quotes to tags: "Look ma, I'm *HTML!" by - cs"<q>
  4. Add parens around this: if *x>3 { by - ysW(
  5. Wrap the word 'world' in "Hello w*orld!" with parens by - ysiw)
  6. Add single quotes around word using visual mode: my $str = *whee!; by - vllllS'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment