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):
35
#541 - Kohei Ito / @kohe

12/06/2012 at 06:33AM

35
#542 - Wes / @Wes36828283

01/28/2020 at 10:43PM

35
#543 - Hunter McGee / @Huntzman56

01/29/2020 at 07:15PM

35
#544 - Muzhou / @Muzhou11

02/01/2020 at 01:29AM

36
#545 - Drew Neil / @nelstrom

12/28/2010 at 09:57PM

36
#546 - Jonathan Wallace / @jonathanwallace

12/29/2010 at 02:34AM

36
#547 - kuhout / @kuhout

12/29/2010 at 02:26PM

36
#548 - Kornél Lugosi / @Coornail

12/29/2010 at 04:56PM

36
#549 - Basir Rajendra / @basirraj

01/25/2011 at 01:57AM

36
#550 - jasper110 / @jasper110

09/21/2011 at 04:30PM

36
#551 - Олег Коваленко / @oleg_kovalenko

04/01/2012 at 09:38AM

36
#552 - Brant / @brantb

06/18/2012 at 04:27AM

36
#553 - CY / @wongcy0

01/27/2013 at 10:07AM

36
#554 - Patrick Oscity / @der_padde

02/11/2014 at 02:13PM

36
#555 - F Prades Illanes / @fprades

10/22/2014 at 11:01AM

36
#556 - Pratap Koritala / @pratap_koritala

02/19/2016 at 12:04PM

36
#557 - Logan Ladd / @LoganLadd3

01/27/2020 at 05:25AM

36
#558 - Ryan Pallman / @RyanPallman

01/30/2020 at 10:27PM

36
#559 - Connor Van Meter / @connorvm

01/31/2020 at 03:33AM

37
#560 - Joe Cyboski / @cybo42

12/29/2010 at 12:42AM

37
#561 - Joe McCall / @joem86

12/29/2010 at 07:33AM

37
#562 - Brad / @bjjwillis

12/30/2010 at 07:41AM

37
#563 - John / @BerlinSchneider

01/19/2014 at 09:36PM

37
#564 - T Gentry / @TGentry36814419

01/22/2020 at 07:15PM

37
#565 - John Hultman / @JohnHultman1

01/23/2020 at 10:58PM

37
#566 - Matthew Wintersteen / @mattt_w4

01/24/2020 at 02:33AM

37
#567 - timebomb / @timebom44359375

01/25/2020 at 11:52PM

37
#568 - Sherbert Jackson / @JacksonSherbert

02/01/2020 at 06:56AM

38
#569 - Analog / @analogp1xel

03/18/2012 at 08:45PM

38
#570 - Johan Berg / @_berg85

01/24/2014 at 03:18PM