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):
38
#571 - playalong / @playwithit42

07/08/2014 at 09:59PM

38
#572 - Mike Wittie / @mike_wittie

01/27/2020 at 05:46PM

39
#573 - Brian Peiris / @brianpeiris

12/28/2013 at 05:55AM

40
#574 - dcbaok / @dcbaok

12/30/2010 at 01:24PM

40
#575 - Stephen Gordon / @DubsGordon

08/02/2011 at 03:19AM

40
#576 - Yegor Klenin / @Kleninz

07/12/2014 at 07:18AM

40
#577 - Goldfish™ / @ImAGoldenFish

01/27/2020 at 10:45PM

41
#578 - Lee Marlow / @lmarlow

12/28/2010 at 09:06PM

41
#579 - Leonard Chin / @lchin

12/29/2010 at 10:01AM

41
#580 - José / @antigravedadtw

11/07/2011 at 08:02PM

41
#581 - sathish316 / @sathish316

11/18/2012 at 05:16PM

41
#582 - Rckrd / @Rckrd

04/09/2013 at 06:48PM

41
#583 - Jonah Hlastala / @JonahHlastala

01/27/2020 at 08:23PM

41
#584 - Olivia Firth / @OliviaFirth4

01/29/2020 at 08:32PM

41
#585 - Colton Weeding / @Doc_Glen_Townie

01/30/2020 at 09:37PM

42
#586 - Jes / @vim_jes

01/15/2011 at 03:54PM

42
#587 - Fred / @fredlee

05/27/2011 at 02:06PM

42
#588 - Jurica / @Jurica34581259

11/16/2018 at 01:09PM

43
#589 - marklu / @marklu

12/29/2010 at 10:04AM

43
#590 - Jason P Bengtson / @bengtson_p

01/30/2020 at 10:35PM

43
#591 - Alonso Darias / @alonso_darias

01/31/2020 at 07:43AM

43
#592 - Sheep Island Productions / @island_sheep

02/01/2020 at 01:40AM

44
#593 - Mike Waldner / @mawaldne

12/31/2010 at 08:02PM

44
#594 - 伺か / @ojiry

08/30/2018 at 10:54AM

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

01/03/2011 at 08:23PM

45
#596 - Robert Xu / @RobertX97592288

11/29/2018 at 01:47AM

46
#597 - Michael Lustfield / @Profarius

12/29/2010 at 07:02AM

46
#598 - Shunichi Kanade / @shunkana

11/04/2018 at 01:35AM

47
#599 - drio / @drio

12/29/2010 at 12:22PM

47
#600 - Algor / @algor_1

10/06/2012 at 12:41PM