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):
23
#271 - Ivan Evtukhovich / @evtuhovich

07/29/2011 at 12:31PM

23
#272 - Jason Then / @racc69

08/08/2011 at 03:18AM

23
#273 - Rambominator / @Rambominator

12/12/2011 at 10:38AM

23
#274 - Martin Petrov / @mgpetrov

08/23/2012 at 12:12PM

23
#275 - Tom Cammann / @tea_sea

10/12/2012 at 11:49AM

23
#276 - Tuonenpoika / @tuonenpoika

01/02/2013 at 08:49PM

23
#277 - n2o4 / @scatotonic

03/16/2013 at 05:04PM

23
#278 - Eric Potter / @pottereric

06/06/2013 at 02:28AM

23
#279 - Michael Coles / @gen_ale_drinker

08/13/2013 at 03:09PM

23
#280 - Fontaine Kévin / @DotSlash974

08/24/2013 at 05:38PM

23
#281 - I / @ForgetIt17

11/23/2013 at 02:16PM

23
#282 - pikaren / @REALpikaren

12/23/2013 at 02:01PM

23
#283 - Andreas Källberg / @Anka213

01/17/2014 at 04:49AM

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

02/03/2014 at 09:15PM

23
#285 - mattsalacain / @mattsalacain

02/04/2014 at 06:04AM

23
#286 - Sntano Euhsk / @SEuhsk

06/02/2014 at 06:19PM

23
#287 - bXpjE4GzUfnPTRHes1mI / @5DQzMDKJs2VoVt

07/03/2014 at 05:55PM

23
#288 - Michael Comerford / @MComerford1

09/23/2014 at 02:01PM

23
#289 - Benny Wong / @bdotdub

04/22/2015 at 02:51PM

23
#290 - Jack Z / @itszhou

06/28/2015 at 06:32PM

23
#291 - Etienne Florent / @EtienneFlorent

11/28/2016 at 09:30AM

23
#292 - Arijus / @argshook

04/12/2018 at 12:56PM

23
#293 - towc / @MateiCopot

05/26/2018 at 10:12PM

23
#294 - fewfold / @fewfold

11/29/2019 at 06:00PM

24
#295 - Jonathan / @jdelStrother

01/02/2011 at 07:42PM

24
#296 - Francisco Dibar / @frandibar

01/08/2011 at 05:50AM

24
#297 - Rob Ciaccio / @RobertoCalavera

01/21/2011 at 08:45AM

24
#298 - Jouko Karvonen / @joukokar

02/03/2011 at 04:59AM

24
#299 - Dmitry Bashkatov / @dbashkatov

10/31/2011 at 01:54PM

24
#300 - mwatkward / @AftrschoolSpe

06/25/2012 at 03:13PM