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

661 active golfers, 2970 entries

Leaderboard (lowest score wins):
21
#181 - Aleksander Gajewski / @adgajewski

04/20/2014 at 03:55PM

21
#182 - eBrnd / @eBrnd

11/02/2014 at 07:47PM

21
#183 - Matt / @mcr05

01/14/2015 at 08:29PM

21
#184 - TweetDreams / @TweetMusicians

10/11/2016 at 03:40AM

21
#185 - Scott Atkins / @scottrick49

06/16/2021 at 01:13PM

22
#186 - Danny Dulai / @dannydulai

12/31/2010 at 07:26AM

22
#187 - fukamikaze / @fukamikaze

01/01/2011 at 04:22AM

22
#188 - Vincent Isambart / @vincentisambart

01/01/2011 at 07:35AM

22
#189 - h_east (トロッコ6個) / @h_east

01/01/2011 at 03:52PM

22
#190 - Jordi Romero / @jordiromero

01/01/2011 at 06:34PM

22
#191 - wyl rof / @wylrof

01/02/2011 at 02:28PM

22
#192 - Tom Burger / @thomasburger

01/04/2011 at 03:31PM

22
#193 - Mark Smith-Guerrero / @msmithgu

01/04/2011 at 06:17PM

22
#194 - Tim Dean / @Tmdean

01/04/2011 at 09:06PM

22
#195 - derp derp / @derp__

01/05/2011 at 07:07AM

22
#196 - Wei Dai / @clvv42

01/07/2011 at 03:52AM

22
#197 - Tim Chase / @gumnos

01/08/2011 at 12:42PM

22
#198 - Balkoth / @_Balkoth_

01/08/2011 at 04:46PM

22
#199 - Saša / @jendvatri

01/09/2011 at 03:13AM

22
#200 - Rörd Hinrichsen / @roerdhh

01/09/2011 at 10:29PM

22
#201 - Luke Sheridan / @lukesheridan

01/10/2011 at 05:11AM

22
#202 - alex scott / @4l3xsc0tt

01/10/2011 at 05:47PM

22
#203 - Pete Johns / @johnsyweb

01/14/2011 at 10:50PM

22
#204 - Oleg Roshupkin / @jjjahson

01/17/2011 at 08:59AM

22
#205 - Andrey Ivanov / @Bytamine

01/19/2011 at 11:52AM

22
#206 - lemming / @darthlemming

01/19/2011 at 06:07PM

22
#207 - Andrey A. Ugolnik / @andreyugolnik

01/22/2011 at 02:58AM

22
#208 - BigBlackBear / @BigBlackBear

01/27/2011 at 09:14PM

22
#209 - Jed Hurt / @meekish

02/06/2011 at 04:53PM

22
#210 - Eivind Jahren / @HaskellElephant

02/19/2011 at 07:22PM