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):
26
#331 - SilentFl / @Silent_Fl

01/27/2015 at 09:44AM

26
#332 - Jake Eskel / @JakeEskel

02/04/2015 at 12:18AM

26
#333 - Maxime / @Maxime_VII

06/10/2015 at 01:16PM

26
#334 - sijinyuan / @sijinyuan

03/09/2017 at 08:58AM

26
#335 - D-Swordman / @junk0612

12/05/2019 at 03:57AM

26
#336 - mase / @ThiccMase

01/31/2020 at 08:34PM

27
#337 - Matthew Draper / @_matthewd

12/29/2010 at 04:04AM

27
#338 - Casey W Crites / @caseycrites

01/01/2011 at 12:33AM

27
#339 - Dezső Zoltán / @zakiazigazi

01/22/2011 at 06:57AM

27
#340 - Avinash Baliga / @avinashbaliga

03/24/2011 at 05:18AM

27
#341 - こばばー / @symmet

05/01/2011 at 02:51PM

27
#342 - mightyfoo / @mightyfoo

05/25/2011 at 12:17PM

27
#343 - Black Wolf / @LoboVimGolf

06/15/2011 at 03:29PM

27
#344 - giggzy / @giggzy

08/17/2011 at 10:52AM

27
#345 - palentine / @palentine

12/12/2011 at 07:36PM

27
#346 - Tesnorth / @Tesnorth

01/31/2012 at 04:58PM

27
#347 - David Xia / @davidxia_

03/24/2012 at 01:16AM

27
#348 - Reed Riley / @ReedRile

08/13/2012 at 07:13PM

27
#349 - Nick Miller / @ItsMeNickMiller

08/17/2012 at 12:15PM

27
#350 - Arne Ehrlich / @typedlambda

09/06/2012 at 06:41AM

27
#351 - Kai Yuan / @kentyuan

02/21/2013 at 01:51PM

27
#352 - Joel Elkins / @dice_tea

03/11/2013 at 03:50PM

27
#353 - HongKilDong / @HongKilDong

03/15/2013 at 11:53AM

27
#354 - Ben / @bdchauvette

05/03/2013 at 08:23AM

27
#355 - Sheng / @shenghis

08/25/2013 at 08:12PM

27
#356 - Oliver Christ / @0liverChrist

09/20/2013 at 03:00PM

27
#357 - Roger Spencer / @RojSpencer

02/02/2014 at 11:59PM

27
#358 - barnabaguy / @barnabaguy

03/02/2014 at 08:41PM

27
#359 - Gerald Tilma / @GeraldTilma

10/18/2015 at 10:26PM

27
#360 - Bogumił Kamiński / @BogumilKaminski

10/26/2015 at 10:37PM