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 587 remaining solutions by signing in and submitting your own entry
#588 Josh Gruber / @Jevitate - Score: 123 - 01/23/20 @ 02:26
i<BS><BS> <Down><Down><Right><Right><BS><BS>  <Up><BS><Down><Right><Right><BS><Down><Down><Right><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS><Up><BS><Right><Right><Del><CR><Up> <Down><Left><Left><Left><Left><Right><Del><Left><Left><Up><Right><Right><Left><Left><Left><Up><Up><Down><Right><Right><Right><Down><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Del><BS><BS><BS><BS>s<Esc>:wq!<CR>

0 comments


Created by: @igrigorik

588 active golfers, 2633 entries

Leaderboard (lowest score wins):
32
#451 - Jason Wolf / @zephyr_wolf

11/08/2012 at 06:10PM

32
#452 - Simon Tost / @Someone_Busy

03/09/2013 at 08:55AM

32
#453 - Matt Adelman / @Xavierstein

03/20/2013 at 06:12PM

32
#454 - Josh Johnson / @jnjosh

04/01/2013 at 07:51AM

32
#455 - Joel Taylor / @joelteon_

07/23/2013 at 02:22AM

32
#456 - Kevin Etienne / @42__kevin

08/18/2013 at 08:03PM

32
#457 - Hachez Floran / @FloranHachez

09/02/2013 at 09:52PM

32
#458 - Devin V. / @enrual

12/15/2013 at 06:16AM

32
#459 - Arthur叔 / @Arthurljg

05/11/2014 at 08:43AM

32
#460 - Jake Eaton / @Jake__Eaton

06/01/2014 at 07:05AM

33
#461 - Dan Callahan / @callahad

12/28/2010 at 08:57PM

33
#462 - Ankit Shankar / @thelastnode

12/30/2010 at 09:18AM

33
#463 - Ben Hall / @Ben_Hall

01/03/2011 at 02:29PM

33
#464 - Chris Waring / @cwaring

01/17/2011 at 10:08PM

33
#465 - Dave / @zzdave13

07/15/2011 at 11:58AM

33
#466 - Katrina Owen / @kytrinyx

08/27/2011 at 08:12PM

33
#467 - Daniel / @dpaneda

09/26/2011 at 08:51PM

33
#468 - sebtyp / @sebtyp

12/15/2011 at 03:06PM

33
#469 - João Veiga / @jcsvveiga

02/13/2012 at 09:44PM

33
#470 - Drew Benedetti / @cnorsl

02/16/2012 at 10:36PM

33
#471 - Darren Firth / @DarrenSFirth

02/20/2012 at 02:53AM

33
#472 - Vicente Sánchez / @froysm

09/09/2012 at 05:28AM

33
#473 - Drew Chandler / @drklutch

10/08/2012 at 11:19PM

33
#474 - Underhill Labs / @underhilllabs

10/29/2012 at 09:26PM

33
#475 - Pradeep Kumar / @pradeep6kumar

12/12/2012 at 01:21PM

33
#476 - scturtle / @scturtle

04/12/2013 at 07:55AM

33
#477 - Leif Bladt / @leifbladt

08/27/2013 at 09:07AM

33
#478 - David Tran / @everyzero

10/30/2013 at 08:12PM

33
#479 - Felipe Jaramillo F / @mrfelipe

04/18/2014 at 01:59PM

33
#480 - Rafee / @rafee_buet

07/22/2014 at 06:28PM