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

625 active golfers, 2728 entries

Leaderboard (lowest score wins):
17
#31 - Sergey / @sav86

05/18/2012 at 03:12AM

17
#32 - Rod Knowlton / @codelahoma

05/26/2012 at 07:31PM

17
#33 - teocx / @teocx

07/08/2012 at 08:36PM

17
#34 - Taylor Rose / @trose89

07/13/2012 at 08:16PM

17
#35 - James Davis / @tripvg

08/03/2012 at 09:55PM

17
#36 - 刘玮 / @lwjef

08/14/2012 at 01:36AM

17
#37 - Eric Söderström / @eksoderstrom

08/14/2012 at 03:35PM

17
#38 - Charles Gordon / @liberalbias

08/23/2012 at 06:17AM

17
#39 - ninjay / @ninjaygolf

08/23/2012 at 01:50PM

17
#40 - Joseph J. Piché / @jjpiche

08/25/2012 at 06:13PM

17
#41 - Joe Nelson / @begriffs

09/03/2012 at 09:30PM

17
#42 - Augustin Trancart / @autra42

09/07/2012 at 04:18PM

17
#43 - Nicholas Clark / @GitNick

09/19/2012 at 06:43PM

17
#44 - Anthony DiGirolamo / @anthonysavatar

09/21/2012 at 03:55AM

17
#45 - Chris Patuzzo / @cpatuzzo

11/03/2012 at 09:56PM

17
#46 - Alex Podaras / @apodaras

11/07/2012 at 05:32PM

17
#47 - BZ_VG / @BZ_VG

11/12/2012 at 09:39AM

17
#48 - Hubba / @HubbaBubbaFett

11/20/2012 at 10:45AM

17
#49 - Urtica dioica / @udioica

12/10/2012 at 04:15AM

17
#50 - Averell Dalton / @webtwoosucks

01/02/2013 at 01:17AM

17
#51 - Ben / @ben_g_thomas

01/09/2013 at 09:00PM

17
#52 - Daniel Jonsson / @DanielJonss

01/17/2013 at 03:54PM

17
#53 - Jimmy Mabey / @mabeyj

01/20/2013 at 08:00PM

17
#54 - Yann Moisan / @YannMoisan

02/01/2013 at 04:18PM

17
#55 - xavier kt / @xav_kt

02/03/2013 at 04:19PM

17
#56 - Andrew Hlavats / @farthestworld

02/24/2013 at 09:40PM

17
#57 - Trevor Powell / @DoomedBunnies

03/20/2013 at 07:16AM

17
#58 - Kate / @Arohanui

04/29/2013 at 05:23AM

17
#59 - Marco Hinz / @_mhinz_

05/23/2013 at 09:05AM

17
#60 - Steve Tjoa / @stevetjoa

07/09/2013 at 08:01PM