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):
19
#151 - Ben Sherman / @bensherman

09/27/2011 at 06:02AM

19
#152 - p0ckets / @p0ckets

10/07/2011 at 12:35AM

19
#153 - André Kvist Aronsen / @andrearonsen

10/24/2011 at 12:41PM

19
#154 - Al / @96258

12/12/2011 at 02:41PM

19
#155 - Peter Anselmo / @peter_anselmo

03/08/2012 at 08:11PM

19
#156 - Chris Penkett / @chrispenkett

04/03/2012 at 07:13PM

19
#157 - learninghang / @learninghang

04/14/2012 at 02:49PM

19
#158 - skarrok / @skarrok

06/17/2012 at 10:37AM

19
#159 - ineb / @ineb0

08/18/2012 at 10:07AM

19
#160 - a24f0600 / @a24f0600

12/13/2012 at 06:52PM

19
#161 - Sebastian Heil / @sebokopter

03/16/2013 at 04:31AM

19
#162 - no name / @vimgol

01/27/2015 at 06:36PM

19
#163 - Kevin Keefe / @KevinKeefe5

05/27/2020 at 05:13PM

20
#164 - fred6 / @_fred6

12/19/2011 at 03:08AM

20
#165 - murky-satyr / @m_satyr

12/29/2011 at 04:30PM

20
#166 - tmr / @tmr314

09/07/2012 at 09:07AM

20
#167 - Marcin Szamotulski / @me_coot

10/10/2013 at 09:50PM

20
#168 - 赤佐田奈葉 / @akasatanaha_

07/03/2018 at 05:27AM

20
#169 - AMG / @anmigneer

12/14/2021 at 08:30AM

20
#170 - july9793 / @july9793_

01/06/2022 at 01:19PM

21
#171 - Emeric Dupont / @stucule

08/23/2011 at 06:47AM

21
#172 - quintin / @quintinjeannoel

08/29/2011 at 08:52AM

21
#173 - sol / @dichotomizer

12/19/2011 at 02:25AM

21
#174 - Nicolas Terray / @nterray

12/27/2011 at 09:34PM

21
#175 - David / @ebonhand09

06/11/2012 at 01:54PM

21
#176 - Tom Sisk / @TomSisk

07/05/2012 at 07:40PM

21
#177 - Darcy Parker / @DarcyParker

10/15/2012 at 11:24PM

21
#178 - Domon / @Domon

02/22/2013 at 07:26AM

21
#179 - Kuldeep Bora / @kuldeep_bora

04/17/2013 at 12:06PM

21
#180 - US Dollar Price / @USDollarPrice

11/04/2013 at 05:26AM