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

663 active golfers, 2979 entries

Leaderboard (lowest score wins):
17
#121 - Brady Cornett / @BradyCornett

01/27/2020 at 07:36PM

17
#122 - Jason Neylon / @jasonneylon

03/06/2020 at 09:11AM

17
#123 - roudens / @roudens2

12/17/2020 at 01:16AM

17
#124 - hepebexè / @hepebexe

12/26/2020 at 11:08PM

17
#125 - Jean George / @JeanGeo20504212

10/03/2021 at 06:03PM

17
#126 - Sean Hwang / @SeanHwangt

02/02/2022 at 06:23PM

17
#127 - ff df / @ffdf93207177

04/18/2022 at 03:08AM

17
#128 - yancy / @yancy_dong

04/29/2022 at 05:24AM

17
#129 - russellzhaomao / @russellzhaomao

05/25/2022 at 02:03AM

17
#130 - josh / @_zvjos

06/17/2022 at 12:11PM

18
#131 - echarp / @charpmanu

11/10/2011 at 01:41AM

18
#132 - You-Siang Lin / @yslinnctu

11/24/2011 at 08:54AM

18
#133 - John Anderson / @opejn

12/30/2011 at 06:39AM

18
#134 - フルメキ / @hurumeki

04/07/2012 at 12:43AM

19
#135 - Terje Larsen / @terlars

04/08/2011 at 01:29AM

19
#136 - kjrn / @kjrnleto

05/22/2011 at 05:57PM

19
#137 - Dragan Cvetinovic / @kawkafi

05/23/2011 at 09:43PM

19
#138 - Justin Hale / @jxl

05/27/2011 at 09:27AM

19
#139 - Emile Swarts / @EmileSwarts

05/29/2011 at 12:23PM

19
#140 - Justin Love / @wondible

06/05/2011 at 07:47PM

19
#141 - dtennant / @dtennant

06/06/2011 at 07:57PM

19
#142 - Rolf Bjaanes / @rolfb

06/15/2011 at 10:08PM

19
#143 - not so punk :] / @notsopunk

06/19/2011 at 08:05AM

19
#144 - Hu Junfeng / @junfeng

07/14/2011 at 08:53AM

19
#145 - Sammasati / @sammasati0

07/15/2011 at 03:49PM

19
#146 - Glenn / @glennular

07/17/2011 at 11:16PM

19
#147 - Ed Gibbs / @edward_gibbs

08/02/2011 at 04:13AM

19
#148 - Neil / @spameldoon

08/21/2011 at 03:14PM

19
#149 - Daniel Stoza / @dstoza

08/26/2011 at 12:40AM

19
#150 - Tim Tsu / @vimgolfpunk

08/29/2011 at 12:34PM