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 4d1e634e509d6e19d8000081

Shebangs for all

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

Start file
#!/usr/bin/ruby

#!/usr/bin/env ruby

#!/usr/local/bin/python

#!/usr/python
End file
#!/usr/bin/env ruby

#!/usr/bin/env python

View Diff

1,2d0
< #!/usr/bin/ruby
< 
5,7c3
< #!/usr/local/bin/python
< 
< #!/usr/python
---
> #!/usr/bin/env python

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 439 remaining solutions by signing in and submitting your own entry
#440 Sven Koesling / @McSvenster - Score: 244 - 08/20/12 @ 14:39
:<Up>%s/\(.*\W\)\(\w\+\)/#\/usr\/bin\/env \2/<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left>!<Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right> | sort! u | %s/^$/d | %s/\n/<C-V><CR><C-V><CR>/<CR><CR>u:<Up><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><CR>:%s/^$/d | %s/\n/^M^M/<CR>:<Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><CR>uu:<Up><Up><Up><Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS>/<CR><CR>kkk4ddZZ

0 comments


Created by: @jamesconroyfinn

440 active golfers, 1618 entries

Leaderboard (lowest score wins):
14
#181 - Cameron White / @_cameronwhite

01/11/2011 at 05:13AM

14
#182 - Joost / @vlabakje

02/22/2011 at 08:03AM

14
#183 - Mike Busch / @mikelikesbikes

06/17/2011 at 04:19AM

14
#184 - IPhone Notiz / @MyIPhoneNotes

11/10/2011 at 05:34PM

14
#185 - omahn / @omahn

01/01/2012 at 10:39AM

14
#186 - Tyler / @tylerbindon

04/05/2013 at 03:33AM

14
#187 - Lieven Keersmaekers / @LievenKeersmaek

06/11/2013 at 05:53PM

14
#188 - Steve Tjoa / @stevetjoa

07/04/2013 at 08:14AM

14
#189 - Matt Green / @emgeeeeee

09/15/2013 at 02:42AM

14
#190 - Stephen Drodge / @sjdrodge

09/15/2013 at 02:42AM

14
#191 - bunnies president / @bunnies4p

10/27/2013 at 09:55PM

14
#192 - Petr Broz / @ipetrbroz

12/20/2013 at 06:59PM

14
#193 - Quota / @Quotad

01/27/2014 at 11:32AM

14
#194 - kli / @klidev

02/03/2014 at 03:54AM

14
#195 - Elizabeth / @sprinkles418

12/18/2014 at 03:32PM

14
#196 - yachi / @yaachi

12/31/2014 at 08:05AM

14
#197 - Evan Coleman / @edc1591

04/25/2015 at 10:41PM

14
#198 - Benny Wong / @bdotdub

04/25/2015 at 10:47PM

14
#199 - Árpád Krejczinger / @krarpi

11/11/2015 at 01:57PM

14
#200 - Will / @obiwan__k3n00bi

09/01/2016 at 06:51AM

14
#201 - Yann / @yannstad

03/01/2017 at 07:52PM

14
#202 - Solomon / @Trugbildjaeger

04/02/2017 at 01:37PM

14
#203 - Melvin Cheung / @MelvinCheung

05/24/2017 at 04:04PM

14
#204 - albalitz / @_albalitz

06/06/2019 at 03:22PM

15
#205 - Jordan Lewis / @JordanALewis

12/31/2010 at 11:34PM

15
#206 - Utkarsh Kukreti / @utkarshkukreti

12/31/2010 at 11:39PM

15
#207 - Leeward Bound / @leewardbound

12/31/2010 at 11:43PM

15
#208 -  Ikhsan Maulana / @ixandidu

12/31/2010 at 11:55PM

15
#209 - Behnam Esfahbod / @zwnj

01/01/2011 at 12:20AM

15
#210 - Casey W Crites / @caseycrites

01/01/2011 at 02:48AM