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):
22
#241 - Marcel Akkerman / @MarcelAkkerman

12/22/2016 at 08:55AM

22
#242 - Carl Egbert / @CarlOEgbert

06/12/2017 at 07:45PM

22
#243 - Vytautas Jakutis / @jakutis0

04/12/2018 at 12:40PM

22
#244 - slicklash / @slicklash

04/12/2018 at 12:45PM

22
#245 - Rebecca V. / @rxbxccxv

09/16/2018 at 05:50AM

22
#246 - PJ Frazer / @pj_frazer

11/22/2018 at 06:00PM

22
#247 - Bhagwan / @El_Bhagwan

05/18/2020 at 02:12AM

23
#248 - Akira Matsuda / @a_matsuda

12/30/2010 at 07:12AM

23
#249 - Alain Gilbert / @alain_gilbert

12/30/2010 at 09:48PM

23
#250 - aimee / @sermoa

01/02/2011 at 05:53PM

23
#251 - Matt Tarbit / @mtarbitdev

01/08/2011 at 03:12PM

23
#252 - Ivan Evtukhovich / @evtuhovich

07/29/2011 at 12:31PM

23
#253 - Jason Then / @racc69

08/08/2011 at 03:18AM

23
#254 - Rambominator / @Rambominator

12/12/2011 at 10:38AM

23
#255 - Martin Petrov / @mgpetrov

08/23/2012 at 12:12PM

23
#256 - Tom Cammann / @tea_sea

10/12/2012 at 11:49AM

23
#257 - Tuonenpoika / @tuonenpoika

01/02/2013 at 08:49PM

23
#258 - n2o4 / @scatotonic

03/16/2013 at 05:04PM

23
#259 - Eric Potter / @pottereric

06/06/2013 at 02:28AM

23
#260 - Michael Coles / @gen_ale_drinker

08/13/2013 at 03:09PM

23
#261 - Fontaine Kévin / @DotSlash974

08/24/2013 at 05:38PM

23
#262 - I / @ForgetIt17

11/23/2013 at 02:16PM

23
#263 - pikaren / @REALpikaren

12/23/2013 at 02:01PM

23
#264 - Andreas Källberg / @Anka213

01/17/2014 at 04:49AM

23
#265 - Павел Игоревич / @VizierST

02/03/2014 at 09:15PM

23
#266 - mattsalacain / @mattsalacain

02/04/2014 at 06:04AM

23
#267 - Sntano Euhsk / @SEuhsk

06/02/2014 at 06:19PM

23
#268 - bXpjE4GzUfnPTRHes1mI / @5DQzMDKJs2VoVt

07/03/2014 at 05:55PM

23
#269 - Michael Comerford / @MComerford1

09/23/2014 at 02:01PM

23
#270 - Benny Wong / @bdotdub

04/22/2015 at 02:51PM