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

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 574 remaining solutions by signing in and submitting your own entry
#575 Stephen Paul Weber / @singpolyma - Score: 94 - 12/28/10 @ 23:48
:%s/\t/  /g<CR>:s/ *$//<Left><Left><Left><Right><Left><Left><Left><Right><Right><Right><Right><Right><Right>g<CR><Up>dd<Up><Up>dd<Esc>:w<BS><BS><End>x:wq<CR>

0 comments


Created by: @igrigorik

575 active golfers, 2618 entries

Leaderboard (lowest score wins):
17
#61 - Ingo / @ist3fani

07/28/2013 at 01:13PM

17
#62 - Chris Webb / @chriswebb_42

08/23/2013 at 02:38AM

17
#63 - thasso / @thasso23

11/01/2013 at 05:52PM

17
#64 - Jonathan Potter / @nTypeRed

11/12/2013 at 04:03PM

17
#65 - Nathan Wallace / @nathanmwallace

11/15/2013 at 07:23PM

17
#66 - Paul Liu / @automorphism

12/23/2013 at 01:23PM

17
#67 - Joonas Pihlajamaa / @jokkebk

02/11/2014 at 12:55PM

17
#68 - John Braxler / @braxler

03/20/2014 at 04:23PM

17
#69 - buz / @buzbone

04/07/2014 at 09:34PM

17
#70 - Jeff / @just_geophree

04/20/2014 at 01:36AM

17
#71 - BJ Terry / @ThatBJTerry

05/26/2014 at 02:59AM

17
#72 - kiho choi / @ArtStandAlone

06/11/2014 at 11:52PM

17
#73 - Robert Bruce / @therealrobru

06/12/2014 at 03:00AM

17
#74 - kimber gonzalez / @kimberlycreates

01/13/2015 at 04:23PM

17
#75 - mark0829 / @mark0829

02/01/2015 at 02:15PM

17
#76 - @sndsgns / @sndsgns

02/27/2015 at 12:18AM

17
#77 - xieyh11 / @xieyh11

02/27/2015 at 10:15AM

17
#78 - pftb12345 / @pftb12345

04/02/2015 at 06:16AM

17
#79 - Robert Robertson / @RobertC3228687

06/09/2015 at 08:32PM

17
#80 - Mutter Mumble / @muttermumble

07/10/2015 at 09:23PM

17
#81 - Walker Boh / @walker_boh

10/07/2015 at 11:14AM

17
#82 - Jon Krause / @jkrause314

01/13/2016 at 05:37PM

17
#83 - Aleksey Zhidkov / @AlexeyZhidkov

02/12/2016 at 05:54AM

17
#84 - Jaron Hamlik / @jdhamlik

02/27/2016 at 11:42PM

17
#85 - Dimitar Dimitrov / @kurkale6ka

03/15/2016 at 10:47AM

17
#86 - jdupont655 / @jdupont655

09/05/2016 at 01:06AM

17
#87 - trx / @trxdbg

10/15/2016 at 11:30AM

17
#88 - Pierre Maoui / @poupougnac

12/29/2016 at 05:36PM

17
#89 - Marcin / @Marcin89439917

12/31/2016 at 11:27AM

17
#90 - Zhihong Liu / @pieapple03

02/27/2017 at 01:15PM