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 802 remaining solutions by signing in and submitting your own entry
#803 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

803 active golfers, 3742 entries

Leaderboard (lowest score wins):
23
#361 - bXpjE4GzUfnPTRHes1mI / @5DQzMDKJs2VoVt

07/03/2014 at 05:55PM

23
#362 - Michael Comerford / @MComerford1

09/23/2014 at 02:01PM

23
#363 - Benny Wong / @bdotdub

04/22/2015 at 02:51PM

23
#364 - Jack Z / @itszhou

06/28/2015 at 06:32PM

23
#365 - Etienne Florent / @EtienneFlorent

11/28/2016 at 09:30AM

23
#366 - Arijus / @argshook

04/12/2018 at 12:56PM

23
#367 - towc / @MateiCopot

05/26/2018 at 10:12PM

23
#368 - fewfold / @fewfold

11/29/2019 at 06:00PM

23
#369 - FeAx / @_FeAx_

06/21/2023 at 10:13PM

23
#370 - rlykins728 / @rlykins728

11/23/2023 at 06:08AM

24
#371 - Jonathan / @jdelStrother

01/02/2011 at 07:42PM

24
#372 - Francisco Dibar / @frandibar

01/08/2011 at 05:50AM

24
#373 - Rob Ciaccio / @RobertoCalavera

01/21/2011 at 08:45AM

24
#374 - Jouko Karvonen / @joukokar

02/03/2011 at 04:59AM

24
#375 - Dmitry Bashkatov / @dbashkatov

10/31/2011 at 01:54PM

24
#376 - mwatkward / @AftrschoolSpe

06/25/2012 at 03:13PM

24
#377 - browsi / @browsi

08/18/2012 at 09:51AM

24
#378 - Jason Bruce / @jbrucenet

09/07/2012 at 11:56PM

24
#379 - Aidan Brumsickle / @aidanbrumsickle

10/05/2012 at 09:25PM

24
#380 - Johan Isacsson / @JohanIsacsson

10/13/2012 at 11:05PM

24
#381 - Ray Lehtiniemi / @rayll

12/09/2012 at 11:44AM

24
#382 - r / @tricosahedron

01/13/2013 at 07:28PM

24
#383 - Sofia Balicka / @so_phifi

03/19/2013 at 10:02AM

24
#384 - Felix Fischer / @felixfischer

02/02/2014 at 05:34PM

24
#385 - フミ ハシ / @fumi_hs

02/22/2014 at 04:44AM

24
#386 - Alexander Kazakov / @volandkot

03/31/2015 at 01:54PM

24
#387 - Tarik Koc / @tariktheturk

11/22/2015 at 01:09AM

24
#388 - Jan Bundesmann / @janbundesmann

04/14/2016 at 01:28PM

24
#389 - Tyler Carson / @tylerccarson

12/29/2021 at 04:22PM

24
#390 - 임덕윤 / @SnLHUF5ZYJXqI1m

08/21/2022 at 03:52PM