Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 4d1bdde3b2c3e0646800007f

Indentation

Indent each line according to the right number of spaces it needs.

Start file
this line doesn’t have indentation
this line is indented with two spaces
this one has four
this other one has two
this one is indented with two spaces
this line has a four spaces indentation
this line needs six spaces
this line needs six spaces too
this line is back to four spaces
this line is finally indented with two spaces
this final line is not indented
End file
this line doesn’t have indentation
  this line is indented with two spaces
    this one has four
  this other one has two
  this one is indented with two spaces
    this line has a four spaces indentation
      this line needs six spaces
      this line needs six spaces too
    this line is back to four spaces
  this line is finally indented with two spaces
this final line is not indented

View Diff

2,10c2,10
< this line is indented with two spaces
< this one has four
< this other one has two
< this one is indented with two spaces
< this line has a four spaces indentation
< this line needs six spaces
< this line needs six spaces too
< this line is back to four spaces
< this line is finally indented with two spaces
---
>   this line is indented with two spaces
>     this one has four
>   this other one has two
>   this one is indented with two spaces
>     this line has a four spaces indentation
>       this line needs six spaces
>       this line needs six spaces too
>     this line is back to four spaces
>   this line is finally indented with two spaces

Solutions by @me_coot:

Unlock 7 remaining solutions by signing in and submitting your own entry
Created by: @remi

158 active golfers, 443 entries

Solutions by @me_coot:
23
#21 - Marcin Szamotulski / @me_coot

11/27/2012 at 09:16PM

24
#>36 - Marcin Szamotulski / @me_coot

11/27/2012 at 09:14PM

25
#>48 - Marcin Szamotulski / @me_coot

11/27/2012 at 09:13PM

26
#>62 - Marcin Szamotulski / @me_coot

11/27/2012 at 09:06PM

26
#>62 - Marcin Szamotulski / @me_coot

11/27/2012 at 09:11PM

37
#>135 - Marcin Szamotulski / @me_coot

11/27/2012 at 09:05PM

41
#>140 - Marcin Szamotulski / @me_coot

11/27/2012 at 09:02PM