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

626 active golfers, 2733 entries

Leaderboard (lowest score wins):
32
#451 - Mirosław Boruta / @m1rk00

12/28/2010 at 10:11PM

32
#452 - Christopher Suter / @cgs1019

12/29/2010 at 04:14AM

32
#453 - Cleve Pasarell / @clevepasarell

12/29/2010 at 09:23PM

32
#454 - Roman Mašek / @romario333

01/02/2011 at 06:48PM

32
#455 - Masashi Iizuka / @uochan

04/03/2011 at 07:23AM

32
#456 - Craig H. Anderson / @CootCraig

04/18/2011 at 03:23PM

32
#457 - Hervo Manuel / @Azema31

05/18/2011 at 07:11PM

32
#458 - Mikhail Korepanov / @PanyaKor

06/13/2011 at 12:55PM

32
#459 - keikun / @funkaloo

06/27/2011 at 03:38AM

32
#460 - Devon Blandin / @dblandin

08/06/2012 at 12:13AM

32
#461 - Kerry Burke / @kurver

09/18/2012 at 09:32AM

32
#462 - Jason Wolf / @zephyr_wolf

11/08/2012 at 06:10PM

32
#463 - Simon Tost / @Someone_Busy

03/09/2013 at 08:55AM

32
#464 - Matt Adelman / @Xavierstein

03/20/2013 at 06:12PM

32
#465 - Josh Johnson / @jnjosh

04/01/2013 at 07:51AM

32
#466 - Joel Taylor / @joelteon_

07/23/2013 at 02:22AM

32
#467 - Kevin Etienne / @42__kevin

08/18/2013 at 08:03PM

32
#468 - Hachez Floran / @FloranHachez

09/02/2013 at 09:52PM

32
#469 - Devin V. / @enrual

12/15/2013 at 06:16AM

32
#470 - Arthur叔 / @Arthurljg

05/11/2014 at 08:43AM

32
#471 - Jake Eaton / @Jake__Eaton

06/01/2014 at 07:05AM

33
#472 - Dan Callahan / @callahad

12/28/2010 at 08:57PM

33
#473 - Ankit Shankar / @thelastnode

12/30/2010 at 09:18AM

33
#474 - Ben Hall / @Ben_Hall

01/03/2011 at 02:29PM

33
#475 - Chris Waring / @cwaring

01/17/2011 at 10:08PM

33
#476 - Dave / @zzdave13

07/15/2011 at 11:58AM

33
#477 - Katrina Owen / @kytrinyx

08/27/2011 at 08:12PM

33
#478 - Daniel / @dpaneda

09/26/2011 at 08:51PM

33
#479 - sebtyp / @sebtyp

12/15/2011 at 03:06PM

33
#480 - João Veiga / @jcsvveiga

02/13/2012 at 09:44PM