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

436 active golfers, 1595 entries

Leaderboard (lowest score wins):
12
#91 - You-Siang Lin / @yslinnctu

12/02/2011 at 12:17PM

12
#92 - Xavier Nayrac / @lkdjiin

12/31/2011 at 11:02AM

12
#93 - Pei-Lun Lee / @ypcatw

01/01/2012 at 01:42PM

12
#94 - Albin Olsson / @sentenser

01/15/2012 at 10:15PM

12
#95 - Renat Aksitov / @Korvin79

02/08/2012 at 12:22AM

12
#96 - Rändöm Tester / @mevcar

02/12/2012 at 04:15PM

12
#97 - Garry Shutler / @gshutler

03/31/2012 at 05:43PM

12
#98 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 09:54PM

12
#99 - Daniel Lundin / @danielundin

06/20/2012 at 01:45PM

12
#100 - mwatkward / @AftrschoolSpe

07/02/2012 at 11:46PM

12
#101 - Conner McDaniel / @connermcd

09/25/2012 at 12:11AM

12
#102 - Vasil Sakarov / @vsakarov

11/11/2012 at 08:11AM

12
#103 - Drew Neil / @nelstrom

11/26/2012 at 11:39PM

12
#104 - Trevor Powell / @DoomedBunnies

03/25/2013 at 05:31AM

12
#105 - Nathan / @NathanHarperoni

07/24/2013 at 03:51PM

12
#106 - Marcin Sza / @coot_

10/11/2013 at 03:15PM

12
#107 - A. N. / @arez42

10/24/2013 at 10:22AM

12
#108 - Casey Dwyer / @caseydwyer

11/04/2013 at 01:54AM

12
#109 - Jérémy Autran / @jjautran

01/31/2014 at 10:31AM

12
#110 - Thomas GUILLORY / @thomasguillory

03/09/2014 at 05:58PM

12
#111 - Amir Kremer / @AmirKremer

03/11/2014 at 01:57PM

12
#112 - Guy Rozen / @HolyEggplant

03/11/2014 at 02:02PM

12
#113 - Joonas Pihlajamaa / @jokkebk

03/17/2014 at 12:23PM

12
#114 - Austin Cormier / @lotusmorc

07/18/2014 at 02:24PM

12
#115 - LC / @leeren

08/11/2014 at 04:35AM

12
#116 - Dmitriy / @_dpy_

08/21/2014 at 12:53PM

12
#117 - kemar / @le_kemar

08/27/2014 at 02:45PM

12
#118 - Johannes H. / @neVexa

10/28/2014 at 04:18PM

12
#119 - Jens Weggemann / @JensWeggemann

12/16/2014 at 08:03PM

12
#120 - ~Nicolas_Poulain / @nicolaspoulain

01/29/2015 at 10:50PM