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

441 active golfers, 1632 entries

Leaderboard (lowest score wins):
12
#91 - kjrn / @kjrnleto

10/06/2011 at 07:22PM

12
#92 - p0ckets / @p0ckets

10/07/2011 at 09:02PM

12
#93 - Milan Dobrota / @milandobrota

11/21/2011 at 04:28AM

12
#94 - William Dunand / @wdunand

11/24/2011 at 09:19AM

12
#95 - You-Siang Lin / @yslinnctu

12/02/2011 at 12:17PM

12
#96 - Xavier Nayrac / @lkdjiin

12/31/2011 at 11:02AM

12
#97 - Pei-Lun Lee / @ypcatw

01/01/2012 at 01:42PM

12
#98 - Albin Olsson / @sentenser

01/15/2012 at 10:15PM

12
#99 - Renat Aksitov / @Korvin79

02/08/2012 at 12:22AM

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

02/12/2012 at 04:15PM

12
#101 - Garry Shutler / @gshutler

03/31/2012 at 05:43PM

12
#102 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 09:54PM

12
#103 - Daniel Lundin / @danielundin

06/20/2012 at 01:45PM

12
#104 - mwatkward / @AftrschoolSpe

07/02/2012 at 11:46PM

12
#105 - Conner McDaniel / @connermcd

09/25/2012 at 12:11AM

12
#106 - Vasil Sakarov / @vsakarov

11/11/2012 at 08:11AM

12
#107 - Drew Neil / @nelstrom

11/26/2012 at 11:39PM

12
#108 - Trevor Powell / @DoomedBunnies

03/25/2013 at 05:31AM

12
#109 - Nathan / @NathanHarperoni

07/24/2013 at 03:51PM

12
#110 - Marcin Sza / @coot_

10/11/2013 at 03:15PM

12
#111 - A. N. / @arez42

10/24/2013 at 10:22AM

12
#112 - Casey Dwyer / @caseydwyer

11/04/2013 at 01:54AM

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

01/31/2014 at 10:31AM

12
#114 - Thomas GUILLORY / @thomasguillory

03/09/2014 at 05:58PM

12
#115 - Amir Kremer / @AmirKremer

03/11/2014 at 01:57PM

12
#116 - Guy Rozen / @HolyEggplant

03/11/2014 at 02:02PM

12
#117 - Joonas Pihlajamaa / @jokkebk

03/17/2014 at 12:23PM

12
#118 - Austin Cormier / @lotusmorc

07/18/2014 at 02:24PM

12
#119 - LC / @leeren

08/11/2014 at 04:35AM

12
#120 - Dmitriy / @_dpy_

08/21/2014 at 12:53PM