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

625 active golfers, 2728 entries

Leaderboard (lowest score wins):
29
#391 - John / @OneOhOneOhOneOh

02/05/2012 at 02:08AM

29
#392 - Robin Deits / @r_deits

03/09/2012 at 11:29PM

29
#393 - metaphract / @metaphract

07/29/2012 at 12:29PM

29
#394 - Eric Andres / @eric_m_andres

12/06/2012 at 05:17AM

29
#395 - Arun / @UArunKumar

12/08/2012 at 04:28AM

29
#396 - くま ก็็็็็็็็็็็็็ʕ•͡ᴥ•ʔ ก้้้้้้้้้้้ 55 / @kumack55

04/03/2013 at 09:09AM

29
#397 - Foo Bar / @FooWatson

12/11/2013 at 09:27PM

29
#398 - Ian Laird / @irlaird

12/13/2013 at 01:23AM

29
#399 - Ram Tamtam / @ramtamtamtam

06/29/2014 at 08:34PM

29
#400 - Yariv / @yarivb

07/27/2014 at 01:56PM

29
#401 - Sabiki94@ブルスクの人 / @_jptomoya

10/18/2014 at 07:52AM

29
#402 - Dian Xiao / @dian_xiao

10/12/2015 at 03:13AM

29
#403 - Tj / @yrddy

03/18/2016 at 04:22AM

29
#404 - Gurukandhamoorthi / @Gurukandhamoor1

07/10/2017 at 03:04PM

29
#405 - Not real / @Notreal70353016

09/23/2018 at 03:15AM

30
#406 - Eric Budd / @clam_tea

12/28/2010 at 09:29PM

30
#407 - Prody / @Prody225

01/10/2011 at 05:23PM

30
#408 - Wesley Wong / @wesleymwwong

01/29/2011 at 08:14AM

30
#409 - TchiKong / @tchikong

01/29/2011 at 12:44PM

30
#410 - Kelan Champagne / @kelan

01/30/2011 at 03:48AM

30
#411 - marssong / @marssong

10/10/2011 at 04:01PM

30
#412 - Arlekin de Palermo / @arlekinpalermo

10/16/2011 at 01:04AM

30
#413 - peter shih / @peter50216

01/06/2012 at 08:30AM

30
#414 - Vishal / @vishl

06/22/2012 at 08:21PM

30
#415 - Nicolas Friedli / @NicolasFriedli

10/28/2012 at 08:51AM

30
#416 - Alec Chen / @alec929

11/03/2012 at 02:17PM

30
#417 - Kenneth Waters / @gen_witt

11/13/2012 at 07:36PM

30
#418 - Nicolas Goles / @ngoles

01/05/2013 at 05:42PM

30
#419 - Ryan Scarbery / @ryan_scarbery

01/11/2013 at 08:27PM

30
#420 - Woojung Kim 김우중 / @_kimwz

07/12/2013 at 04:35AM