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):
22
#181 - Oleg Roshupkin / @jjjahson

01/17/2011 at 08:59AM

22
#182 - Andrey Ivanov / @Bytamine

01/19/2011 at 11:52AM

22
#183 - lemming / @darthlemming

01/19/2011 at 06:07PM

22
#184 - Andrey A. Ugolnik / @andreyugolnik

01/22/2011 at 02:58AM

22
#185 - BigBlackBear / @BigBlackBear

01/27/2011 at 09:14PM

22
#186 - Jed Hurt / @meekish

02/06/2011 at 04:53PM

22
#187 - Eivind Jahren / @HaskellElephant

02/19/2011 at 07:22PM

22
#188 - vg / @vimgolfer

02/19/2011 at 10:49PM

22
#189 - Ruy Diaz / @diazruy

03/09/2011 at 06:02PM

22
#190 - Arthur Hinh / @arthur_hinh

03/20/2011 at 12:11PM

22
#191 - Thom Hughes / @thom_hughes_1

03/28/2011 at 01:21AM

22
#192 - icdark / @icdark

05/29/2011 at 10:22PM

22
#193 - Damian Dawber / @damian6970

06/05/2011 at 01:04PM

22
#194 - Jone Marius Vignes / @inful

06/08/2011 at 10:30PM

22
#195 - Rolf K. / @mindleftbody

06/17/2011 at 11:56AM

22
#196 - sjatkinson / @sjatkinson

08/29/2011 at 04:05PM

22
#197 - Nick Reynolds / @ndreynolds

09/14/2011 at 06:42AM

22
#198 - Martin Janiczek / @janiczek

10/16/2011 at 11:16PM

22
#199 - 0x5042 / @0x5042

11/27/2011 at 07:17PM

22
#200 - William Dunand / @wdunand

12/13/2011 at 01:53AM

22
#201 - Xavier Nayrac / @lkdjiin

12/29/2011 at 12:17PM

22
#202 - Sergio Benitez / @Sergio965

01/30/2012 at 07:11PM

22
#203 - Marcin Górnik / @gornikm

01/30/2012 at 10:08PM

22
#204 - Raúl Pedroche / @pedrocheisback

02/07/2012 at 09:17PM

22
#205 - Kristopher Urie / @kristopherurie

02/10/2012 at 05:23AM

22
#206 - Shane Emmons / @semmons99

02/13/2012 at 12:55PM

22
#207 - 無ん垢の叫び / @john_ababa

02/21/2012 at 03:47PM

22
#208 - Pawel Obrok / @mrYapee

03/13/2012 at 02:08PM

22
#209 - drupalovereasy / @drupalovereasy

04/14/2012 at 07:39AM

22
#210 - david ta / @tadavid

04/15/2012 at 10:38PM