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

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

862 active golfers, 4044 entries

Solutions by @GavinKoeng:
17
#198 - Gavin / @GavinKoeng

07/13/2026 at 08:33AM

18
#>205 - Gavin / @GavinKoeng

07/13/2026 at 08:32AM

19
#>236 - Gavin / @GavinKoeng

07/13/2026 at 08:32AM

20
#>246 - Gavin / @GavinKoeng

07/13/2026 at 08:32AM

22
#>369 - Gavin / @GavinKoeng

07/13/2026 at 08:29AM

22
#>369 - Gavin / @GavinKoeng

07/13/2026 at 08:29AM

23
#>401 - Gavin / @GavinKoeng

07/13/2026 at 08:29AM

25
#>445 - Gavin / @GavinKoeng

07/13/2026 at 08:29AM

26
#>478 - Gavin / @GavinKoeng

07/13/2026 at 08:28AM

27
#>511 - Gavin / @GavinKoeng

07/13/2026 at 08:28AM

28
#>540 - Gavin / @GavinKoeng

07/13/2026 at 08:28AM

29
#>568 - Gavin / @GavinKoeng

07/13/2026 at 08:28AM

30
#>592 - Gavin / @GavinKoeng

07/13/2026 at 08:27AM