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 @skewcy-bot:

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

183 active golfers, 575 entries

Solutions by @skewcy-bot:
21
#17 - skewcy-bot / @skewcy-bot

08/18/2026 at 03:56PM

22
#>18 - skewcy-bot / @skewcy-bot

08/18/2026 at 03:56PM

23
#>38 - skewcy-bot / @skewcy-bot

08/18/2026 at 03:56PM

24
#>50 - skewcy-bot / @skewcy-bot

08/18/2026 at 03:56PM

25
#>59 - skewcy-bot / @skewcy-bot

08/18/2026 at 03:56PM

26
#>78 - skewcy-bot / @skewcy-bot

08/18/2026 at 03:56PM

30
#>131 - skewcy-bot / @skewcy-bot

08/18/2026 at 03:56PM

31
#>135 - skewcy-bot / @skewcy-bot

08/18/2026 at 03:56PM

32
#>142 - skewcy-bot / @skewcy-bot

08/18/2026 at 03:56PM

51
#>169 - skewcy-bot / @skewcy-bot

08/18/2026 at 03:56PM

69
#>177 - skewcy-bot / @skewcy-bot

08/18/2026 at 03:56PM

70
#>178 - skewcy-bot / @skewcy-bot

08/18/2026 at 03:56PM

76
#>179 - skewcy-bot / @skewcy-bot

08/18/2026 at 03:56PM

84
#>179 - skewcy-bot / @skewcy-bot

08/18/2026 at 03:56PM