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

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

745 active golfers, 3413 entries

Solutions by @ShannonGu1031:
17
#161 - shannon / @ShannonGu1031

05/26/2024 at 08:39AM

18
#>166 - shannon / @ShannonGu1031

05/26/2024 at 08:30AM

18
#>166 - shannon / @ShannonGu1031

05/26/2024 at 08:35AM

19
#>196 - shannon / @ShannonGu1031

05/26/2024 at 08:23AM

19
#>196 - shannon / @ShannonGu1031

05/26/2024 at 08:27AM

20
#>205 - shannon / @ShannonGu1031

05/26/2024 at 08:19AM

20
#>205 - shannon / @ShannonGu1031

05/26/2024 at 08:21AM

22
#>310 - shannon / @ShannonGu1031

05/26/2024 at 08:12AM

22
#>310 - shannon / @ShannonGu1031

05/26/2024 at 08:13AM

22
#>310 - shannon / @ShannonGu1031

05/26/2024 at 08:14AM

22
#>310 - shannon / @ShannonGu1031

05/26/2024 at 08:16AM

23
#>342 - shannon / @ShannonGu1031

05/26/2024 at 08:07AM

25
#>382 - shannon / @ShannonGu1031

05/26/2024 at 05:32AM

25
#>382 - shannon / @ShannonGu1031

05/26/2024 at 05:45AM

26
#>411 - shannon / @ShannonGu1031

05/25/2024 at 04:54PM

27
#>440 - shannon / @ShannonGu1031

05/25/2024 at 04:53PM

29
#>490 - shannon / @ShannonGu1031

05/25/2024 at 04:47PM

34
#>631 - shannon / @ShannonGu1031

05/25/2024 at 04:49PM

35
#>646 - shannon / @ShannonGu1031

05/25/2024 at 04:46PM

37
#>673 - shannon / @ShannonGu1031

05/25/2024 at 04:40PM

40
#>687 - shannon / @ShannonGu1031

05/25/2024 at 04:35PM