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):
27
#451 - giggzy / @giggzy

08/17/2011 at 10:52AM

27
#452 - palentine / @palentine

12/12/2011 at 07:36PM

27
#453 - Tesnorth / @Tesnorth

01/31/2012 at 04:58PM

27
#454 - David Xia / @davidxia_

03/24/2012 at 01:16AM

27
#455 - Reed Riley / @ReedRile

08/13/2012 at 07:13PM

27
#456 - Nick Miller / @ItsMeNickMiller

08/17/2012 at 12:15PM

27
#457 - Arne Ehrlich / @typedlambda

09/06/2012 at 06:41AM

27
#458 - Kai Yuan / @kentyuan

02/21/2013 at 01:51PM

27
#459 - Joel Elkins / @dice_tea

03/11/2013 at 03:50PM

27
#460 - HongKilDong / @HongKilDong

03/15/2013 at 11:53AM

27
#461 - Ben / @bdchauvette

05/03/2013 at 08:23AM

27
#462 - Sheng / @shenghis

08/25/2013 at 08:12PM

27
#463 - Oliver Christ / @0liverChrist

09/20/2013 at 03:00PM

27
#464 - Roger Spencer / @RojSpencer

02/02/2014 at 11:59PM

27
#465 - barnabaguy / @barnabaguy

03/02/2014 at 08:41PM

27
#466 - Gerald Tilma / @GeraldTilma

10/18/2015 at 10:26PM

27
#467 - Bogumił Kamiński / @BogumilKaminski

10/26/2015 at 10:37PM

27
#468 - SK Liew / @liewsk

11/06/2015 at 04:39AM

27
#469 - jb M / @Jiboo_hey

04/20/2016 at 07:44PM

27
#470 - Christian / @paierlep

09/03/2019 at 10:38PM

27
#471 - satake0916 / @satake0916

01/05/2024 at 02:38AM

27
#472 - Seungho Lee / @llistnr

07/24/2024 at 04:01AM

27
#473 - Aditya Singh / @0xaditya

08/23/2024 at 06:35PM

27
#474 - tofitsch / @tofitsch

10/06/2024 at 09:28AM

28
#475 - Samus_ Michael / @gonna_hate

12/29/2010 at 02:19AM

28
#476 - Arjen Schat / @arjenschat

12/29/2010 at 06:24PM

28
#477 - jacobangel / @jacobangel

12/31/2010 at 05:38AM

28
#478 - garygordon / @garygordon

01/01/2011 at 07:37PM

28
#479 - Nick / @quinks25

01/10/2011 at 03:37AM

28
#480 - Pavlo Klets / @p01nt

02/04/2011 at 02:54PM