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):
23
#271 - Jack Z / @itszhou

06/28/2015 at 06:32PM

23
#272 - Etienne Florent / @EtienneFlorent

11/28/2016 at 09:30AM

23
#273 - Arijus / @argshook

04/12/2018 at 12:56PM

23
#274 - towc / @MateiCopot

05/26/2018 at 10:12PM

23
#275 - fewfold / @fewfold

11/29/2019 at 06:00PM

24
#276 - Jonathan / @jdelStrother

01/02/2011 at 07:42PM

24
#277 - Francisco Dibar / @frandibar

01/08/2011 at 05:50AM

24
#278 - Rob Ciaccio / @RobertoCalavera

01/21/2011 at 08:45AM

24
#279 - Jouko Karvonen / @joukokar

02/03/2011 at 04:59AM

24
#280 - Dmitry Bashkatov / @dbashkatov

10/31/2011 at 01:54PM

24
#281 - mwatkward / @AftrschoolSpe

06/25/2012 at 03:13PM

24
#282 - browsi / @browsi

08/18/2012 at 09:51AM

24
#283 - Jason Bruce / @jbrucenet

09/07/2012 at 11:56PM

24
#284 - Aidan Brumsickle / @aidanbrumsickle

10/05/2012 at 09:25PM

24
#285 - Johan Isacsson / @JohanIsacsson

10/13/2012 at 11:05PM

24
#286 - Ray Lehtiniemi / @rayll

12/09/2012 at 11:44AM

24
#287 - r / @tricosahedron

01/13/2013 at 07:28PM

24
#288 - Sofia Balicka / @so_phifi

03/19/2013 at 10:02AM

24
#289 - Felix Fischer / @felixfischer

02/02/2014 at 05:34PM

24
#290 - フミ ハシ / @fumi_hs

02/22/2014 at 04:44AM

24
#291 - Alexander Kazakov / @volandkot

03/31/2015 at 01:54PM

24
#292 - Tarik Koc / @tariktheturk

11/22/2015 at 01:09AM

24
#293 - Jan Bundesmann / @janbundesmann

04/14/2016 at 01:28PM

25
#294 - Utkarsh Kukreti / @utkarshkukreti

12/29/2010 at 06:15PM

25
#295 - Henri Bourcereau / @mmai

12/30/2010 at 11:44AM

25
#296 - Steve Morrow / @yawmark

01/14/2011 at 04:10AM

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

11/23/2011 at 04:20PM

25
#298 - dharmapurikar / @dharmapurikar

11/30/2011 at 11:25AM

25
#299 - Tim Blair / @timblair

02/16/2012 at 03:10PM

25
#300 - ise0615 / @ise0615

05/04/2012 at 04:41PM