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

803 active golfers, 3742 entries

Leaderboard (lowest score wins):
32
#601 - lethalNeutrino / @lethalNeutrino

11/28/2023 at 01:09PM

32
#602 - KarateSnoopy / @KarateSnoopy

08/12/2024 at 09:23AM

32
#603 - reatter / @reatter

09/17/2024 at 04:59PM

32
#604 - Andrew / @a0di

11/02/2024 at 05:36PM

32
#605 - UrbanNinja1010 / @UrbanNinja1010

04/07/2025 at 12:04PM

33
#606 - Dan Callahan / @callahad

12/28/2010 at 08:57PM

33
#607 - Ankit Shankar / @thelastnode

12/30/2010 at 09:18AM

33
#608 - Ben Hall / @Ben_Hall

01/03/2011 at 02:29PM

33
#609 - Chris Waring / @cwaring

01/17/2011 at 10:08PM

33
#610 - Dave / @zzdave13

07/15/2011 at 11:58AM

33
#611 - Katrina Owen / @kytrinyx

08/27/2011 at 08:12PM

33
#612 - Daniel / @dpaneda

09/26/2011 at 08:51PM

33
#613 - sebtyp / @sebtyp

12/15/2011 at 03:06PM

33
#614 - João Veiga / @jcsvveiga

02/13/2012 at 09:44PM

33
#615 - Drew Benedetti / @cnorsl

02/16/2012 at 10:36PM

33
#616 - Darren Firth / @DarrenSFirth

02/20/2012 at 02:53AM

33
#617 - Vicente Sánchez / @froysm

09/09/2012 at 05:28AM

33
#618 - Drew Chandler / @drklutch

10/08/2012 at 11:19PM

33
#619 - Underhill Labs / @underhilllabs

10/29/2012 at 09:26PM

33
#620 - Pradeep Kumar 🇮🇳🇮🇳🇮🇳🇮🇱🇮🇱🇮🇱 / @pradeep6kumar

12/12/2012 at 01:21PM

33
#621 - scturtle / @scturtle

04/12/2013 at 07:55AM

33
#622 - Leif Bladt / @leifbladt

08/27/2013 at 09:07AM

33
#623 - David Tran / @everyzero

10/30/2013 at 08:12PM

33
#624 - Felipe Jaramillo F / @mrfelipe

04/18/2014 at 01:59PM

33
#625 - Rafee / @rafee_buet

07/22/2014 at 06:28PM

33
#626 - Almog / @almog

07/27/2014 at 01:48PM

33
#627 - CJ Avilla / @cjav_dev

11/12/2014 at 05:25PM

33
#628 - David Willming / @wdialvmeo

07/17/2015 at 03:47AM

33
#629 - Mike Adams / @davis_cromwell

10/03/2015 at 01:26AM

33
#630 - Jon McClennon / @mcclennon19

12/21/2016 at 10:08AM