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

783 active golfers, 3646 entries

Leaderboard (lowest score wins):
16
#1 - Kerson Hsiao / @KersonHsiao

08/09/2012 at 03:40PM

16
#2 - Conner McDaniel / @connermcd

09/18/2012 at 04:14PM

16
#3 - Victor Ramirez / @virako

10/16/2012 at 12:53AM

16
#4 - Adam Bell / @adamgbell

02/19/2013 at 08:33PM

16
#5 - Petro Тrouq / @zulolosi

03/26/2013 at 07:27AM

16
#6 - Chaitanya Desu / @ChaituNu

05/04/2014 at 11:47PM

16
#7 - jackliusr / @jackliusr

01/14/2016 at 05:46AM

16
#8 - ben kavanagh / @bkava

02/24/2016 at 02:33AM

16
#9 - 梧桐王子 / @WutongYujie

05/05/2017 at 01:40AM

16
#10 - Bennett Bernardoni / @BBernardoni

07/03/2017 at 08:14PM

16
#11 - ParasamGateZero / @ParasamGateZero

02/10/2018 at 04:58AM

16
#12 - GreenPinguin / @GreenPinguin2

03/27/2018 at 12:19PM

16
#13 - Guirec CORBEL / @GuirecCorbel

04/05/2018 at 12:51AM

16
#14 - Daniël De Koker / @daniel_koker

07/02/2018 at 07:48AM

16
#15 - Chris Budetti / @ChrisBudetti

10/14/2018 at 04:32PM

16
#16 - Grant / @grant_7788

05/07/2019 at 08:26AM

16
#17 - Mario Olofo / @mario_olofo

10/24/2019 at 02:00AM

16
#18 - floyd / @floyd10086

05/12/2020 at 04:40AM

16
#19 - Karol Łukaszewicz / @Karolukaszewicz

06/25/2020 at 01:57PM

16
#20 - Jung Yeon Park / @park_jungy

01/11/2021 at 05:06PM

16
#21 - lydxn / @lydxn1

07/25/2021 at 03:41AM

16
#22 - Flimsy Giraffe / @flimsy_giraffe

11/28/2021 at 01:19PM

16
#23 - Pedro Minicz / @pedrominicz

03/26/2022 at 10:48PM

16
#24 - unchi / @unchi10723002

05/07/2022 at 08:32AM

16
#25 - Levi Wheeler / @LeviWhe68726437

06/16/2022 at 05:43PM

16
#26 - Andreas Näsman / @andreas_nasman

06/19/2022 at 01:46PM

16
#27 - z00master / @z00master

08/04/2022 at 05:41PM

16
#28 - Qing Liu / @poeminlash

08/06/2022 at 10:18PM

16
#29 - Janzen / @__Coos

09/15/2022 at 07:24AM

16
#30 - Александр Моисеев / @Aleksan43607471

01/19/2023 at 12:28PM