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 574 remaining solutions by signing in and submitting your own entry
#575 Stephen Paul Weber / @singpolyma - Score: 94 - 12/28/10 @ 23:48
:%s/\t/  /g<CR>:s/ *$//<Left><Left><Left><Right><Left><Left><Left><Right><Right><Right><Right><Right><Right>g<CR><Up>dd<Up><Up>dd<Esc>:w<BS><BS><End>x:wq<CR>

0 comments


Created by: @igrigorik

575 active golfers, 2618 entries

Leaderboard (lowest score wins):
34
#511 - ⚡ DRJ ⚡ / @midgetjones

06/08/2013 at 05:24PM

34
#512 - Alexey / @kramar42

07/04/2013 at 04:10PM

34
#513 - Sami Niiranen / @saminiir

10/13/2013 at 02:51PM

34
#514 - Jay R Bolton / @the_swerve

01/29/2014 at 02:40AM

34
#515 - Omer Lachish / @rauchy

07/27/2014 at 01:49PM

34
#516 - daveseibert / @daveseibert

08/02/2014 at 03:54AM

34
#517 - Raj / @brshenoy

04/22/2015 at 03:19PM

34
#518 - Micheal Wells / @michealwwells

08/01/2018 at 04:37PM

35
#519 - lionel young / @lionelyoung

12/28/2010 at 09:15PM

35
#520 - foo bar / @whoever_foo

12/29/2010 at 08:06AM

35
#521 - Thomas Schönwälder / @Masei1988

01/15/2011 at 07:58PM

35
#522 - nicolas bo / @thevegeta

11/08/2011 at 02:58PM

35
#523 - Dj Vimgolf / @dj_vimgolf

12/31/2011 at 07:23PM

35
#524 - Kohei Ito / @kohe

12/06/2012 at 06:33AM

36
#525 - Drew Neil / @nelstrom

12/28/2010 at 09:57PM

36
#526 - Jonathan Wallace / @jonathanwallace

12/29/2010 at 02:34AM

36
#527 - kuhout / @kuhout

12/29/2010 at 02:26PM

36
#528 - Kornél Lugosi / @Coornail

12/29/2010 at 04:56PM

36
#529 - Basir Rajendra / @basirraj

01/25/2011 at 01:57AM

36
#530 - jasper110 / @jasper110

09/21/2011 at 04:30PM

36
#531 - Олег Коваленко / @oleg_kovalenko

04/01/2012 at 09:38AM

36
#532 - Brant / @brantb

06/18/2012 at 04:27AM

36
#533 - CY / @wongcy0

01/27/2013 at 10:07AM

36
#534 - Patrick Oscity / @der_padde

02/11/2014 at 02:13PM

36
#535 - F Prades Illanes / @fprades

10/22/2014 at 11:01AM

36
#536 - Pratap Koritala / @pratap_koritala

02/19/2016 at 12:04PM

37
#537 - Joe Cyboski / @cybo42

12/29/2010 at 12:42AM

37
#538 - Joe McCall / @joem86

12/29/2010 at 07:33AM

37
#539 - Brad / @bjjwillis

12/30/2010 at 07:41AM

37
#540 - John / @BerlinSchneider

01/19/2014 at 09:36PM