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

661 active golfers, 2970 entries

Leaderboard (lowest score wins):
22
#211 - vg / @vimgolfer

02/19/2011 at 10:49PM

22
#212 - Ruy Diaz / @diazruy

03/09/2011 at 06:02PM

22
#213 - Arthur Hinh / @arthur_hinh

03/20/2011 at 12:11PM

22
#214 - Thom Hughes / @thom_hughes_1

03/28/2011 at 01:21AM

22
#215 - icdark / @icdark

05/29/2011 at 10:22PM

22
#216 - Damian Dawber / @damian6970

06/05/2011 at 01:04PM

22
#217 - Jone Marius Vignes / @inful

06/08/2011 at 10:30PM

22
#218 - Rolf K. / @mindleftbody

06/17/2011 at 11:56AM

22
#219 - sjatkinson / @sjatkinson

08/29/2011 at 04:05PM

22
#220 - Nick Reynolds / @ndreynolds

09/14/2011 at 06:42AM

22
#221 - Martin Janiczek / @janiczek

10/16/2011 at 11:16PM

22
#222 - 0x5042 / @0x5042

11/27/2011 at 07:17PM

22
#223 - William Dunand / @wdunand

12/13/2011 at 01:53AM

22
#224 - Xavier Nayrac / @lkdjiin

12/29/2011 at 12:17PM

22
#225 - Sergio Benitez / @Sergio965

01/30/2012 at 07:11PM

22
#226 - Marcin Górnik / @gornikm

01/30/2012 at 10:08PM

22
#227 - Raúl Pedroche / @pedrocheisback

02/07/2012 at 09:17PM

22
#228 - Kristopher Urie / @kristopherurie

02/10/2012 at 05:23AM

22
#229 - Shane Emmons / @semmons99

02/13/2012 at 12:55PM

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

02/21/2012 at 03:47PM

22
#231 - Pawel Obrok / @mrYapee

03/13/2012 at 02:08PM

22
#232 - drupalovereasy / @drupalovereasy

04/14/2012 at 07:39AM

22
#233 - david ta / @tadavid

04/15/2012 at 10:38PM

22
#234 - David Pflug / @dpflug

05/17/2012 at 09:48PM

22
#235 - vansan / @VinceVansan

08/27/2012 at 08:53PM

22
#236 - deigen / @deigen0

08/28/2012 at 10:59PM

22
#237 - Lee Folkman / @leefolkman

09/24/2012 at 05:44PM

22
#238 - robin hafen / @rohafen

09/28/2012 at 03:29PM

22
#239 - z0k / @z0k

12/20/2012 at 12:16AM

22
#240 - Xinruo Sun / @xiaoruoruo

12/23/2012 at 10:47AM