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

661 active golfers, 2970 entries

Leaderboard (lowest score wins):
24
#301 - browsi / @browsi

08/18/2012 at 09:51AM

24
#302 - Jason Bruce / @jbrucenet

09/07/2012 at 11:56PM

24
#303 - Aidan Brumsickle / @aidanbrumsickle

10/05/2012 at 09:25PM

24
#304 - Johan Isacsson / @JohanIsacsson

10/13/2012 at 11:05PM

24
#305 - Ray Lehtiniemi / @rayll

12/09/2012 at 11:44AM

24
#306 - r / @tricosahedron

01/13/2013 at 07:28PM

24
#307 - Sofia Balicka / @so_phifi

03/19/2013 at 10:02AM

24
#308 - Felix Fischer / @felixfischer

02/02/2014 at 05:34PM

24
#309 - フミ ハシ / @fumi_hs

02/22/2014 at 04:44AM

24
#310 - Alexander Kazakov / @volandkot

03/31/2015 at 01:54PM

24
#311 - Tarik Koc / @tariktheturk

11/22/2015 at 01:09AM

24
#312 - Jan Bundesmann / @janbundesmann

04/14/2016 at 01:28PM

24
#313 - Tyler Carson / @tylerccarson

12/29/2021 at 04:22PM

25
#314 - Utkarsh Kukreti / @utkarshkukreti

12/29/2010 at 06:15PM

25
#315 - Henri Bourcereau / @mmai

12/30/2010 at 11:44AM

25
#316 - Steve Morrow / @yawmark

01/14/2011 at 04:10AM

25
#317 - R.T. Lechow / @rtlechow

11/23/2011 at 04:20PM

25
#318 - dharmapurikar / @dharmapurikar

11/30/2011 at 11:25AM

25
#319 - Tim Blair / @timblair

02/16/2012 at 03:10PM

25
#320 - ise0615 / @ise0615

05/04/2012 at 04:41PM

25
#321 - Andrey Yankin / @YankinAndrey

07/20/2012 at 08:12AM

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

11/25/2012 at 07:43PM

25
#323 - Goran Petrovity / @nasdukar

04/07/2013 at 04:33PM

25
#324 - iantalks / @iantalks

05/11/2013 at 04:54PM

25
#325 - Aaron Bieber / @aaronbieber

07/15/2013 at 10:05PM

25
#326 - cj / @cj01101

08/04/2013 at 07:35PM

25
#327 - James / @Dronak

09/17/2013 at 02:37AM

25
#328 - mnx / @mnxx

12/23/2014 at 10:24AM

25
#329 - vgmct / @vgmct

04/25/2015 at 09:00PM

25
#330 - MikeT / @mik3t

09/15/2015 at 10:53PM