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):
17
#91 - Marcin / @Marcin89439917

12/31/2016 at 11:27AM

17
#92 - Zhihong Liu / @pieapple03

02/27/2017 at 01:15PM

17
#93 - Solomon / @Trugbildjaeger

04/23/2017 at 05:28PM

17
#94 - Remus Dalrymple / @bornintheflames

05/06/2017 at 12:26AM

17
#95 - Turkey Man / @lvturkeyman

11/10/2017 at 05:52PM

17
#96 - Benoit Mortgat / @Benoit_Mortgat

11/15/2017 at 07:45AM

17
#97 - LC / @leeren

03/02/2018 at 06:25AM

17
#98 - niwatoco / @yoshitune9

07/23/2018 at 08:13PM

17
#99 - fucus / @fishlovebanana

08/06/2018 at 12:57PM

17
#100 - fsj / @FrogzSJ

08/19/2018 at 11:56PM

17
#101 - vg / @vg53210350

10/28/2018 at 10:17PM

17
#102 - Brendan B Amdocs / @AmdocsB

11/08/2018 at 05:51PM

17
#103 - Dax / @zacoxi

11/09/2018 at 09:39AM

17
#104 - name / @name65894813

11/20/2018 at 03:39PM

17
#105 - Mihai / @mihaicristiant

12/05/2018 at 06:30PM

17
#106 - guxbug / @guxbug1

12/24/2018 at 03:06AM

17
#107 - majo senf / @majo_senf

06/18/2019 at 11:42AM

17
#108 - Miłosz Łakomy / @foobar01123

08/15/2019 at 01:22PM

17
#109 - Baine Wedlock / @BaineWedlock

09/26/2019 at 09:49AM

17
#110 - Viktor Styrud / @ViktorStyrud

10/14/2019 at 03:04PM

17
#111 - vimgolfer / @vimgolfer7

11/02/2019 at 03:04PM

17
#112 - Lory / @Lory46845742

11/14/2019 at 09:31AM

17
#113 - James Casey / @hanavi

12/22/2019 at 03:53AM

17
#114 - Brady Cornett / @BradyCornett

01/27/2020 at 07:36PM

17
#115 - Jason Neylon / @jasonneylon

03/06/2020 at 09:11AM

18
#116 - echarp / @charpmanu

11/10/2011 at 01:41AM

18
#117 - You-Siang Lin / @yslinnctu

11/24/2011 at 08:54AM

18
#118 - John Anderson / @opejn

12/30/2011 at 06:39AM

18
#119 - フルメキ / @hurumeki

04/07/2012 at 12:43AM

19
#120 - Terje Larsen / @terlars

04/08/2011 at 01:29AM