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
#271 - lemming / @darthlemming

01/19/2011 at 06:07PM

22
#272 - Andrey A. Ugolnik / @andreyugolnik

01/22/2011 at 02:58AM

22
#273 - BigBlackBear / @BigBlackBear

01/27/2011 at 09:14PM

22
#274 - Jed Hurt / @meekish

02/06/2011 at 04:53PM

22
#275 - Eivind Jahren / @HaskellElephant

02/19/2011 at 07:22PM

22
#276 - vg / @vimgolfer

02/19/2011 at 10:49PM

22
#277 - Ruy Diaz / @diazruy

03/09/2011 at 06:02PM

22
#278 - Arthur Hinh / @arthur_hinh

03/20/2011 at 12:11PM

22
#279 - Thom Hughes / @thom_hughes_1

03/28/2011 at 01:21AM

22
#280 - icdark / @icdark

05/29/2011 at 10:22PM

22
#281 - Damian Dawber / @damian6970

06/05/2011 at 01:04PM

22
#282 - Jone Marius Vignes / @inful

06/08/2011 at 10:30PM

22
#283 - Rolf K. / @mindleftbody

06/17/2011 at 11:56AM

22
#284 - sjatkinson / @sjatkinson

08/29/2011 at 04:05PM

22
#285 - Nick Reynolds / @ndreynolds

09/14/2011 at 06:42AM

22
#286 - Martin Janiczek / @janiczek

10/16/2011 at 11:16PM

22
#287 - 0x5042 / @0x5042

11/27/2011 at 07:17PM

22
#288 - William Dunand / @wdunand

12/13/2011 at 01:53AM

22
#289 - Xavier Nayrac / @lkdjiin

12/29/2011 at 12:17PM

22
#290 - Sergio Benitez / @Sergio965

01/30/2012 at 07:11PM

22
#291 - Marcin Górnik / @gornikm

01/30/2012 at 10:08PM

22
#292 - Raúl Pedroche / @pedrocheisback

02/07/2012 at 09:17PM

22
#293 - Kristopher Urie / @kristopherurie

02/10/2012 at 05:23AM

22
#294 - Shane Emmons / @semmons99

02/13/2012 at 12:55PM

22
#295 - じょんあば / @john_ababa

02/21/2012 at 03:47PM

22
#296 - Pawel Obrok / @mrYapee

03/13/2012 at 02:08PM

22
#297 - drupalovereasy / @drupalovereasy

04/14/2012 at 07:39AM

22
#298 - david ta / @tadavid

04/15/2012 at 10:38PM

22
#299 - David Pflug / @dpflug

05/17/2012 at 09:48PM

22
#300 - vansan / @VinceVansan

08/27/2012 at 08:53PM