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

460 active golfers, 1730 entries

Leaderboard (lowest score wins):
13
#181 - pftb12345 / @pftb12345

04/07/2015 at 12:33PM

13
#182 - Jeremiah Goyette / @JeremiahGoyette

08/03/2016 at 06:18AM

13
#183 - Pierre Maoui / @poupougnac

12/29/2016 at 05:55PM

13
#184 - Daniel / @Daniel00288663

03/30/2017 at 01:28PM

13
#185 - Nigel Nye / @nigel_nye

05/31/2020 at 11:48PM

14
#186 - xer0x / @xer0x

01/01/2011 at 12:43AM

14
#187 - Douglas Stockwell / @dstockwell

01/01/2011 at 02:28AM

14
#188 - Pierre / @Pihour

01/01/2011 at 03:00AM

14
#189 - Mattiassich Ákos / @mattiassicha

01/01/2011 at 03:23PM

14
#190 - Kamil Yurtsever / @y313

01/03/2011 at 10:47PM

14
#191 - Karl Eklund / @keklund

01/04/2011 at 09:01AM

14
#192 - Cameron White / @_cameronwhite

01/11/2011 at 05:13AM

14
#193 - Joost / @vlabakje

02/22/2011 at 08:03AM

14
#194 - Mike Busch / @mikelikesbikes

06/17/2011 at 04:19AM

14
#195 - IPhone Notiz / @MyIPhoneNotes

11/10/2011 at 05:34PM

14
#196 - omahn / @omahn

01/01/2012 at 10:39AM

14
#197 - Tyler / @tylerbindon

04/05/2013 at 03:33AM

14
#198 - Lieven Keersmaekers / @LievenKeersmaek

06/11/2013 at 05:53PM

14
#199 - Steve Tjoa / @stevetjoa

07/04/2013 at 08:14AM

14
#200 - Matt Green / @emgeeeeee

09/15/2013 at 02:42AM

14
#201 - Stephen Drodge / @sjdrodge

09/15/2013 at 02:42AM

14
#202 - bunnies president / @bunnies4p

10/27/2013 at 09:55PM

14
#203 - Petr Broz / @ipetrbroz

12/20/2013 at 06:59PM

14
#204 - Quota / @Quotad

01/27/2014 at 11:32AM

14
#205 - kli / @klidev

02/03/2014 at 03:54AM

14
#206 - Elizabeth / @sprinkles418

12/18/2014 at 03:32PM

14
#207 - yachi / @yaachi

12/31/2014 at 08:05AM

14
#208 - Evan Coleman / @edc1591

04/25/2015 at 10:41PM

14
#209 - Benny Wong / @bdotdub

04/25/2015 at 10:47PM

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

11/11/2015 at 01:57PM