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 4d1a4d82a860b7447200008d

Whitespace, empty lines and tabs

Convert tabs to spaces, strip empty lines and trailing whitespace.

Start file
	convert tabs to spaces

		strip all blank lines 

	and remove any trailing spaces   
End file
  convert tabs to spaces
    strip all blank lines
  and remove any trailing spaces

View Diff

1,5c1,3
< 	convert tabs to spaces
< 
< 		strip all blank lines 
< 
< 	and remove any trailing spaces   
---
>   convert tabs to spaces
>     strip all blank lines
>   and remove any trailing spaces

Solutions by @sjkobayashi:

Unlock 10 remaining solutions by signing in and submitting your own entry
Created by: @igrigorik

847 active golfers, 3967 entries

Solutions by @sjkobayashi:
17
#192 - Shunto J. Kobayashi / @sjkobayashi

02/13/2026 at 02:17PM

18
#>199 - Shunto J. Kobayashi / @sjkobayashi

02/13/2026 at 02:13PM

19
#>231 - Shunto J. Kobayashi / @sjkobayashi

02/13/2026 at 02:13PM

20
#>241 - Shunto J. Kobayashi / @sjkobayashi

02/13/2026 at 02:11PM

21
#>269 - Shunto J. Kobayashi / @sjkobayashi

02/13/2026 at 01:49PM

21
#>269 - Shunto J. Kobayashi / @sjkobayashi

02/13/2026 at 02:00PM

23
#>391 - Shunto J. Kobayashi / @sjkobayashi

02/13/2026 at 01:48PM

25
#>435 - Shunto J. Kobayashi / @sjkobayashi

02/13/2026 at 01:47PM

28
#>530 - Shunto J. Kobayashi / @sjkobayashi

02/13/2026 at 01:46PM

31
#>610 - Shunto J. Kobayashi / @sjkobayashi

02/13/2026 at 01:44PM