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

663 active golfers, 2979 entries

Leaderboard (lowest score wins):
33
#511 - Drew Benedetti / @cnorsl

02/16/2012 at 10:36PM

33
#512 - Darren Firth / @DarrenSFirth

02/20/2012 at 02:53AM

33
#513 - Vicente Sรกnchez / @froysm

09/09/2012 at 05:28AM

33
#514 - Drew Chandler / @drklutch

10/08/2012 at 11:19PM

33
#515 - Underhill Labs / @underhilllabs

10/29/2012 at 09:26PM

33
#516 - Pradeep Kumar ๐Ÿ‡ฎ๐Ÿ‡ณ๐Ÿ‡ฎ๐Ÿ‡ณ๐Ÿ‡ฎ๐Ÿ‡ณ๐Ÿ‡ฎ๐Ÿ‡ฑ๐Ÿ‡ฎ๐Ÿ‡ฑ๐Ÿ‡ฎ๐Ÿ‡ฑ / @pradeep6kumar

12/12/2012 at 01:21PM

33
#517 - scturtle / @scturtle

04/12/2013 at 07:55AM

33
#518 - Leif Bladt / @leifbladt

08/27/2013 at 09:07AM

33
#519 - David Tran / @everyzero

10/30/2013 at 08:12PM

33
#520 - Felipe Jaramillo F / @mrfelipe

04/18/2014 at 01:59PM

33
#521 - Rafee / @rafee_buet

07/22/2014 at 06:28PM

33
#522 - Almog / @almog

07/27/2014 at 01:48PM

33
#523 - CJ Avilla / @wizemanip

11/12/2014 at 05:25PM

33
#524 - David Willming / @wdialvmeo

07/17/2015 at 03:47AM

33
#525 - Mike Adams / @davis_cromwell

10/03/2015 at 01:26AM

33
#526 - Jon McClennon / @mcclennon19

12/21/2016 at 10:08AM

33
#527 - Daniel / @Daniel00288663

03/27/2017 at 11:11AM

33
#528 - Prithviraj Patil / @dummyprithviraj

12/03/2017 at 09:39PM

33
#529 - Geoff / @RealGeoffErwin

12/14/2017 at 09:07PM

33
#530 - sspan / @sspantz

07/06/2018 at 01:24AM

33
#531 - Vim Golfer / @VimGolfer6

09/06/2019 at 11:26AM

33
#532 - ใ‚†ใ‹ใŠ๐Ÿฆฉ๐Ÿฆฉ / @yucao24hours

12/10/2019 at 04:41AM

33
#533 - lin / @l_shi1

01/31/2020 at 09:06AM

33
#534 - Patrick Gates / @patrickgates

06/15/2021 at 12:10AM

33
#535 - Adam / @Adam75625825

07/04/2021 at 01:36PM

34
#536 - Soliman Sylvain / @sylvain_soliman

12/28/2010 at 10:07PM

34
#537 - Andrei Dragomir / @adragomir

01/01/2011 at 09:45PM

34
#538 - Cartney McLennon / @mepsi_pax

01/05/2011 at 10:01PM

34
#539 - Misha (Mike) Granin / @Granin

01/19/2011 at 04:19PM

34
#540 - Matthieu Honel / @ocus

01/26/2011 at 08:09AM