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 558 remaining solutions by signing in and submitting your own entry
#559 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

559 active golfers, 2508 entries

Leaderboard (lowest score wins):
16
#1 - Kerson Hsiao / @KersonHsiao

08/09/2012 at 03:40PM

16
#2 - Conner McDaniel / @connermcd

09/18/2012 at 04:14PM

16
#3 - Victor Ramirez / @virako

10/16/2012 at 12:53AM

16
#4 - Adam Bell / @adamgbell

02/19/2013 at 08:33PM

16
#5 - Petro Тrouq / @zulolosi

03/26/2013 at 07:27AM

16
#6 - Chaitanya Desu / @ChaituNu

05/04/2014 at 11:47PM

16
#7 - jackliusr / @jackliusr

01/14/2016 at 05:46AM

16
#8 - ben kavanagh / @bkava

02/24/2016 at 02:33AM

16
#9 - 梧桐王子 / @WutongYujie

05/05/2017 at 01:40AM

16
#10 - Bennett Bernardoni / @BBernardoni

07/03/2017 at 08:14PM

16
#11 - ParasamGateZero / @ParasamGateZero

02/10/2018 at 04:58AM

16
#12 - GreenPinguin / @GreenPinguin2

03/27/2018 at 12:19PM

16
#13 - Guirec CORBEL / @GuirecCorbel

04/05/2018 at 12:51AM

16
#14 - Daniël De Koker / @daniel_koker

07/02/2018 at 07:48AM

16
#15 - Chris Budetti / @ChrisBudetti

10/14/2018 at 04:32PM

17
#16 - Pei-Lun Lee / @ypcatw

12/23/2011 at 12:05AM

17
#17 - Tara Bass / @tara_bass

12/26/2011 at 06:06AM

17
#18 - oliver mueller / @marcontwit

01/21/2012 at 04:20PM

17
#19 - Zeh Rizzatti / @zehrizzatti

02/05/2012 at 10:06PM

17
#20 - Vasil Sakarov / @vsakarov

02/14/2012 at 06:28PM

17
#21 - Renat Aksitov / @Korvin79

02/14/2012 at 08:49PM

17
#22 - Federico Galassi / @federicogalassi

02/22/2012 at 05:31PM

17
#23 - Ravil Bayramgalin / @brainopia

03/16/2012 at 01:26AM

17
#24 - Nolen Royalty / @NolenRoyalty

04/22/2012 at 12:52AM

17
#25 - Son of Bongo / @bpcode

05/06/2012 at 01:45PM

17
#26 - VimGolfDzNrSQleot / @VimGolfDzNrSQle

05/11/2012 at 12:19AM

17
#27 - Sergey / @sav86

05/18/2012 at 03:12AM

17
#28 - Rod Knowlton / @codelahoma

05/26/2012 at 07:31PM

17
#29 - teocx / @teocx

07/08/2012 at 08:36PM

17
#30 - Taylor Rose / @trose89

07/13/2012 at 08:16PM