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):
22
#331 - Ксения / @Xvluk

08/16/2021 at 08:28PM

22
#332 - ­김수현 / 학생 / 건설환경공학부 / @gimsuhyeonhags1

03/24/2023 at 07:53AM

22
#333 - robit ultra lark / @RobitUltra

04/18/2023 at 08:40PM

22
#334 - Golf Vim / @GolfVim11388

06/30/2023 at 08:02PM

22
#335 - Marius Ropotica / @cipmar

03/31/2024 at 06:48PM

22
#336 - Jack Barry / @Jack-Barry

06/07/2024 at 01:42AM

22
#337 - SanderHestvik / @SanderHestvik

06/09/2024 at 09:35PM

22
#338 - Adi / @adi2004

09/16/2024 at 09:10AM

22
#339 - akashcapitalnumbers / @akashcapitalnumbers

12/25/2024 at 06:49PM

22
#340 - Ben / @meyerben

01/14/2025 at 12:20AM

23
#341 - Akira Matsuda / @a_matsuda

12/30/2010 at 07:12AM

23
#342 - Alain Gilbert / @alain_gilbert

12/30/2010 at 09:48PM

23
#343 - aimee / @sermoa

01/02/2011 at 05:53PM

23
#344 - Matt Tarbit / @mtarbitdev

01/08/2011 at 03:12PM

23
#345 - Ivan Evtukhovich / @evtuhovich

07/29/2011 at 12:31PM

23
#346 - Jason Then / @racc69

08/08/2011 at 03:18AM

23
#347 - Rambominator / @Rambominator

12/12/2011 at 10:38AM

23
#348 - Martin Petrov / @mgpetrov

08/23/2012 at 12:12PM

23
#349 - T / @tea_sea

10/12/2012 at 11:49AM

23
#350 - Tuonenpoika / @tuonenpoika

01/02/2013 at 08:49PM

23
#351 - n2o4 / @scatotonic

03/16/2013 at 05:04PM

23
#352 - Eric Potter / @pottereric

06/06/2013 at 02:28AM

23
#353 - Michael Coles / @gen_ale_drinker

08/13/2013 at 03:09PM

23
#354 - Fontaine Kévin / @DotSlash974

08/24/2013 at 05:38PM

23
#355 - I / @ForgetIt17

11/23/2013 at 02:16PM

23
#356 - pikaren / @REALpikaren

12/23/2013 at 02:01PM

23
#357 - Andreas Källberg / @Anka213

01/17/2014 at 04:49AM

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

02/03/2014 at 09:15PM

23
#359 - mattsalacain / @mattsalacain

02/04/2014 at 06:04AM

23
#360 - Sntano Euhsk / @SEuhsk

06/02/2014 at 06:19PM