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 624 remaining solutions by signing in and submitting your own entry
#625 Zac sliker / @Zacsliker - Score: 125 - 01/29/20 @ 16:29
<Left>d5w<Down>dwd<Left><Left><Left><Left>d5w<Down>dw<Left>d6wi<Up><Up><50-53>  convert tabs to spaces<CR>    strip all blank lines<CR>  and remove any trailing spaces<Esc>[201~<Down><Down><BS><BS><Esc>:wq!<CR>

0 comments


Created by: @igrigorik

625 active golfers, 2728 entries

Leaderboard (lowest score wins):
25
#301 - Andrey Yankin / @YankinAndrey

07/20/2012 at 08:12AM

25
#302 - Adelar S. Queiróz / @adelarsq

11/25/2012 at 07:43PM

25
#303 - Goran Petrovity / @nasdukar

04/07/2013 at 04:33PM

25
#304 - iantalks / @iantalks

05/11/2013 at 04:54PM

25
#305 - Aaron Bieber / @aaronbieber

07/15/2013 at 10:05PM

25
#306 - cj / @cj01101

08/04/2013 at 07:35PM

25
#307 - James / @Dronak

09/17/2013 at 02:37AM

25
#308 - mnx / @mnxx

12/23/2014 at 10:24AM

25
#309 - vgmct / @vgmct

04/25/2015 at 09:00PM

25
#310 - MikeT / @mik3t

09/15/2015 at 10:53PM

25
#311 - slawry00 / @slawry00

02/01/2020 at 06:50AM

26
#312 -  Ikhsan Maulana / @ixandidu

12/30/2010 at 08:50AM

26
#313 - Benoit D / @Anbcorp

12/30/2010 at 10:59AM

26
#314 - Behnam Esfahbod / @zwnj

12/30/2010 at 01:22PM

26
#315 - Juan C. Muller / @juancmuller

12/31/2010 at 07:10PM

26
#316 - Nándor Komzák / @rubymood

01/01/2011 at 06:11PM

26
#317 - Ben Griffiths / @beng

01/11/2011 at 05:13PM

26
#318 - Mateusz Zawisza / @mateuszzawisza

01/26/2011 at 09:42PM

26
#319 - Ilya Strukov / @i1ey

05/01/2011 at 05:07PM

26
#320 - Jim Infield / @jinfield

07/14/2011 at 04:59AM

26
#321 - Simon's Calf / @simonscarfe

08/30/2011 at 02:51PM

26
#322 - Luismi Cavallé / @cavalle

04/07/2012 at 11:14AM

26
#323 - Mikko Loponen / @lopossumi

10/22/2012 at 05:39PM

26
#324 - うえっち / @uh_tomo

12/04/2012 at 04:03PM

26
#325 - Robottinosino / @Robottinosino

05/18/2013 at 06:13PM

26
#326 - Johannes Faigle / @jayeff

08/27/2013 at 10:02AM

26
#327 - Jacob / @jayekub

03/23/2014 at 08:11PM

26
#328 - Amir Kremer / @AmirKremer

07/27/2014 at 01:40PM

26
#329 - Rails Girls Tel-Aviv / @RailsGirlsTLV

07/27/2014 at 01:52PM

26
#330 - Joseph Roberts / @joey9801

01/23/2015 at 02:57PM