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

626 active golfers, 2733 entries

Leaderboard (lowest score wins):
30
#421 - Woojung Kim 김우중 / @_kimwz

07/12/2013 at 04:35AM

30
#422 - Stefan Leszkiewicz / @stefanlz

11/17/2013 at 12:18AM

30
#423 - Will / @obiwan__k3n00bi

07/31/2016 at 08:26PM

30
#424 - Jeff / @sir_wiggles3

09/11/2018 at 07:33AM

30
#425 - Iuno Jones / @IunoJones

01/31/2020 at 02:22AM

30
#426 - countime / @countime1

03/13/2020 at 09:49AM

31
#427 - uuu / @uu59

12/29/2010 at 08:27PM

31
#428 - David Shaw / @shawthings

12/30/2010 at 10:04AM

31
#429 - Solomon White / @rubysolo

02/08/2011 at 04:03PM

31
#430 - Mike Marion / @mikejmarion

03/21/2011 at 08:03AM

31
#431 - Tom N / @tomjnixon

12/09/2011 at 09:23PM

31
#432 - Alykhan Kanji / @alykhank

08/17/2012 at 06:02PM

31
#433 - Joshua Travis / @jktravis

11/11/2012 at 02:47AM

31
#434 - Jordan Eldredge / @captbaritone

12/01/2012 at 08:43AM

31
#435 - Paul Roberts / @psxpau1

12/12/2012 at 10:42PM

31
#436 - XGOLFER / @vimg0lfer

01/04/2013 at 03:10AM

31
#437 - Terry Ma / @terry_ma

01/06/2013 at 04:58AM

31
#438 - Scott Myц / @ScottMuc

04/07/2013 at 04:36AM

31
#439 - Bitt Faulk / @bittfaulk

04/30/2013 at 05:26PM

31
#440 - Kathryn / @hartknyx

05/17/2013 at 02:16AM

31
#441 - Timothée Gauthier / @zmf_tim

07/13/2013 at 06:57AM

31
#442 - foo / @foo88832727

10/18/2013 at 03:58PM

31
#443 - Ben Lambeth / @azy2_ben

02/15/2014 at 06:55PM

31
#444 - gioanna miller / @gionnamiller

03/18/2014 at 11:26AM

31
#445 - Cavaillé Léo / @leoc892

04/09/2015 at 03:15AM

31
#446 - Ben Hill / @KaizenSoze70

05/09/2016 at 05:05PM

31
#447 - Brian Hall / @_bruab_

03/23/2017 at 02:58PM

31
#448 - Marius Jurgelenas / @MarenasLT

04/12/2018 at 12:29PM

31
#449 - Sachin Akula / @AkulaSachin

08/01/2018 at 05:11PM

31
#450 - Austin / @Austin57093958

01/23/2020 at 07:44PM