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 @jgke_:

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

158 active golfers, 443 entries

Solutions by @jgke_:
23
#26 - Jaakko Hannikainen / @jgke_

09/08/2014 at 09:39PM

24
#>39 - Jaakko Hannikainen / @jgke_

09/08/2014 at 09:39PM

25
#>48 - Jaakko Hannikainen / @jgke_

09/08/2014 at 09:38PM

26
#>65 - Jaakko Hannikainen / @jgke_

09/08/2014 at 09:38PM

27
#>77 - Jaakko Hannikainen / @jgke_

09/08/2014 at 09:37PM

28
#>83 - Jaakko Hannikainen / @jgke_

09/08/2014 at 09:37PM

29
#>90 - Jaakko Hannikainen / @jgke_

09/08/2014 at 09:37PM

30
#>115 - Jaakko Hannikainen / @jgke_

09/08/2014 at 09:35PM

31
#>118 - Jaakko Hannikainen / @jgke_

09/08/2014 at 09:35PM

33
#>130 - Jaakko Hannikainen / @jgke_

09/08/2014 at 09:34PM

34
#>132 - Jaakko Hannikainen / @jgke_

09/08/2014 at 09:22PM