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 585 remaining solutions by signing in and submitting your own entry
#586 Josh Gruber / @Jevitate - Score: 123 - 01/23/20 @ 02:26
i<BS><BS> <Down><Down><Right><Right><BS><BS>  <Up><BS><Down><Right><Right><BS><Down><Down><Right><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS><Up><BS><Right><Right><Del><CR><Up> <Down><Left><Left><Left><Left><Right><Del><Left><Left><Up><Right><Right><Left><Left><Left><Up><Up><Down><Right><Right><Right><Down><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Del><BS><BS><BS><BS>s<Esc>:wq!<CR>

0 comments


Created by: @igrigorik

586 active golfers, 2631 entries

Leaderboard (lowest score wins):
37
#541 - Brad / @bjjwillis

12/30/2010 at 07:41AM

37
#542 - John / @BerlinSchneider

01/19/2014 at 09:36PM

37
#543 - T Gentry / @TGentry36814419

01/22/2020 at 07:15PM

37
#544 - John Hultman / @JohnHultman1

01/23/2020 at 10:58PM

37
#545 - Matthew Wintersteen / @mattt_w4

01/24/2020 at 02:33AM

38
#546 - Analog / @analogp1xel

03/18/2012 at 08:45PM

38
#547 - Johan Berg / @_berg85

01/24/2014 at 03:18PM

38
#548 - playalong / @playwithit42

07/08/2014 at 09:59PM

39
#549 - Brian Peiris / @brianpeiris

12/28/2013 at 05:55AM

40
#550 - dcbaok / @dcbaok

12/30/2010 at 01:24PM

40
#551 - Stephen Gordon / @DubsGordon

08/02/2011 at 03:19AM

40
#552 - Yegor Klenin / @Kleninz

07/12/2014 at 07:18AM

41
#553 - Lee Marlow / @lmarlow

12/28/2010 at 09:06PM

41
#554 - Leonard Chin / @lchin

12/29/2010 at 10:01AM

41
#555 - José / @antigravedadtw

11/07/2011 at 08:02PM

41
#556 - sathish316 / @sathish316

11/18/2012 at 05:16PM

41
#557 - Rckrd / @Rckrd

04/09/2013 at 06:48PM

42
#558 - Jes / @vim_jes

01/15/2011 at 03:54PM

42
#559 - Fred / @fredlee

05/27/2011 at 02:06PM

42
#560 - Jurica / @Jurica34581259

11/16/2018 at 01:09PM

43
#561 - marklu / @marklu

12/29/2010 at 10:04AM

44
#562 - Mike Waldner / @mawaldne

12/31/2010 at 08:02PM

44
#563 - 伺か / @ojiry

08/30/2018 at 10:54AM

45
#564 - Корнев Руслан / @woto7

01/03/2011 at 08:23PM

45
#565 - Robert Xu / @RobertX97592288

11/29/2018 at 01:47AM

46
#566 - Michael Lustfield / @Profarius

12/29/2010 at 07:02AM

46
#567 - Shunichi Kanade / @shunkana

11/04/2018 at 01:35AM

46
#568 - Brady Cornett / @BradyCornett

01/24/2020 at 08:52PM

47
#569 - drio / @drio

12/29/2010 at 12:22PM

47
#570 - Algor / @algor_1

10/06/2012 at 12:41PM