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):
27
#361 - SK Liew / @liewsk

11/06/2015 at 04:39AM

27
#362 - jb M / @Jiboo_hey

04/20/2016 at 07:44PM

27
#363 - Christian / @paierlep

09/03/2019 at 10:38PM

28
#364 - Samus_ Michael / @gonna_hate

12/29/2010 at 02:19AM

28
#365 - Arjen Schat / @arjenschat

12/29/2010 at 06:24PM

28
#366 - jacobangel / @jacobangel

12/31/2010 at 05:38AM

28
#367 - garygordon / @garygordon

01/01/2011 at 07:37PM

28
#368 - Nick / @quinks25

01/10/2011 at 03:37AM

28
#369 - Pavlo Klets / @p01nt

02/04/2011 at 02:54PM

28
#370 - Petrik de Heus / @four54

08/24/2011 at 05:41PM

28
#371 - Scott Mathson / @smathson

02/04/2012 at 01:40AM

28
#372 - Jyun-Fan Tsai / @fakecolor

02/04/2012 at 08:28AM

28
#373 - Daniel Cohen / @danielissimo

02/07/2012 at 06:12PM

28
#374 - Daniel Rucci / @drucci

02/07/2012 at 07:20PM

28
#375 - Tim Uruski / @timuruski

02/08/2012 at 05:52AM

28
#376 - Glen / @Glen_S

08/11/2012 at 12:41AM

28
#377 - Michi Loro / @michiloro

07/22/2014 at 10:45AM

28
#378 - Evan Coleman / @edc1591

04/22/2015 at 02:54PM

28
#379 - we’re going to need a bigger bot / @assaflavie

05/10/2015 at 05:51PM

28
#380 - Hendrik Lammers / @hendriklammers

05/19/2015 at 06:37PM

28
#381 - Kyouma / @kyoumaJohn

10/14/2016 at 06:02PM

28
#382 - timerella® / @timerella

11/17/2016 at 12:55AM

28
#383 - Matthew Mackay / @matthewmackay26

08/01/2018 at 04:54PM

28
#384 - Ivo Blöchliger / @aigledesalpes

08/06/2019 at 08:54AM

28
#385 - ram / @rambory

01/25/2020 at 10:12PM

29
#386 - Grigoriy Glushko / @grinderrz

01/07/2011 at 03:08PM

29
#387 - ☣Rob Mason☠ / @necr0mancer

01/18/2011 at 12:39PM

29
#388 - Anders Janmyr / @andersjanmyr

01/24/2011 at 04:13PM

29
#389 - drooooooooooo / @droooooooooooo

08/07/2011 at 06:36AM

29
#390 - Michael Morgan / @1n1n1s3

11/28/2011 at 08:49PM