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):
17
#91 - Jon Krause / @jkrause314

01/13/2016 at 05:37PM

17
#92 - Aleksey Zhidkov / @AlexeyZhidkov

02/12/2016 at 05:54AM

17
#93 - Jaron Hamlik / @jdhamlik

02/27/2016 at 11:42PM

17
#94 - Dimitar Dimitrov / @kurkale6ka

03/15/2016 at 10:47AM

17
#95 - jdupont655 / @jdupont655

09/05/2016 at 01:06AM

17
#96 - trx / @trxdbg

10/15/2016 at 11:30AM

17
#97 - Pierre Maoui / @poupougnac

12/29/2016 at 05:36PM

17
#98 - Marcin / @Marcin89439917

12/31/2016 at 11:27AM

17
#99 - Zhihong Liu / @pieapple03

02/27/2017 at 01:15PM

17
#100 - Solomon / @Trugbildjaeger

04/23/2017 at 05:28PM

17
#101 - Remus Dalrymple / @bornintheflames

05/06/2017 at 12:26AM

17
#102 - Turkey Man / @lvturkeyman

11/10/2017 at 05:52PM

17
#103 - Benoit Mortgat / @Benoit_Mortgat

11/15/2017 at 07:45AM

17
#104 - LC / @leeren

03/02/2018 at 06:25AM

17
#105 - niwatoco / @yoshitune9

07/23/2018 at 08:13PM

17
#106 - fucus / @fishlovebanana

08/06/2018 at 12:57PM

17
#107 - fsj / @FrogzSJ

08/19/2018 at 11:56PM

17
#108 - vg / @vg53210350

10/28/2018 at 10:17PM

17
#109 - Brendan B Amdocs / @AmdocsB

11/08/2018 at 05:51PM

17
#110 - Dax / @zacoxi

11/09/2018 at 09:39AM

17
#111 - name / @name65894813

11/20/2018 at 03:39PM

17
#112 - Mihai / @mihaicristiant

12/05/2018 at 06:30PM

17
#113 - guxbug / @guxbug1

12/24/2018 at 03:06AM

17
#114 - majo senf / @majo_senf

06/18/2019 at 11:42AM

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

08/15/2019 at 01:22PM

17
#116 - Baine Wedlock / @BaineWedlock

09/26/2019 at 09:49AM

17
#117 - Viktor Styrud / @ViktorStyrud

10/14/2019 at 03:04PM

17
#118 - vimgolfer / @vimgolfer7

11/02/2019 at 03:04PM

17
#119 - Lory / @Lory46845742

11/14/2019 at 09:31AM

17
#120 - James Casey / @hanavi

12/22/2019 at 03:53AM