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

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

787 active golfers, 3665 entries

Solutions by @andreas_nasman:
16
#26 - Andreas Näsman / @andreas_nasman

06/19/2022 at 01:46PM

16
#>26 - Andreas Näsman / @andreas_nasman

06/19/2022 at 02:55PM

16
#>28 - Andreas Näsman / @andreas_nasman

09/03/2022 at 01:20PM

17
#>152 - Andreas Näsman / @andreas_nasman

06/19/2022 at 11:37AM

18
#>182 - Andreas Näsman / @andreas_nasman

06/19/2022 at 11:31AM

19
#>212 - Andreas Näsman / @andreas_nasman

06/19/2022 at 11:28AM

21
#>237 - Andreas Näsman / @andreas_nasman

06/19/2022 at 11:23AM

22
#>324 - Andreas Näsman / @andreas_nasman

06/19/2022 at 11:22AM

24
#>380 - Andreas Näsman / @andreas_nasman

06/19/2022 at 11:20AM

28
#>489 - Andreas Näsman / @andreas_nasman

06/19/2022 at 11:17AM

31
#>567 - Andreas Näsman / @andreas_nasman

06/18/2022 at 09:23AM