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
#61 - Brad / @bjjwillis

01/01/2011 at 11:38AM

12
#62 - Prody / @Prody225

01/01/2011 at 03:42PM

12
#63 - Ricardo Mendes / @locks

01/01/2011 at 04:03PM

12
#64 - Wei Dai / @clvv42

01/01/2011 at 09:55PM

12
#65 - Renaud Morvan / @neleanth

01/01/2011 at 10:08PM

12
#66 - rabidpraxis / @rabidpraxis

01/01/2011 at 11:12PM

12
#67 - Akira Matsuda / @a_matsuda

01/02/2011 at 03:37PM

12
#68 - Tien Le / @tienlex

01/02/2011 at 06:33PM

12
#69 - Corey Purcell / @coreypurcell

01/03/2011 at 02:47PM

12
#70 - Benoît Ryder / @benoitryder

01/03/2011 at 10:22PM

12
#71 - Clément Nodet / @clementnodet

01/03/2011 at 10:27PM

12
#72 - aaaa3331 / @aaaa3331

01/03/2011 at 10:47PM

12
#73 - Aaron Bull Schaefer / @elasticdog

01/05/2011 at 12:03AM

12
#74 - oliboli / @oliboliboli

01/06/2011 at 11:17AM

12
#75 - Ujjwol Lamichhane / @Ujjwol

01/07/2011 at 10:19AM

12
#76 - derp derp / @derp__

01/09/2011 at 03:32AM

12
#77 - Pablo Villalba / @micho

01/09/2011 at 03:41PM

12
#78 - Toto l'haricot / @nico_le_terribl

01/09/2011 at 06:52PM

12
#79 - Balkoth / @_Balkoth_

01/09/2011 at 08:38PM

12
#80 - Agus Lopez / @aguslr

01/10/2011 at 10:51PM

12
#81 - Eivind Jahren / @HaskellElephant

01/17/2011 at 03:47PM

12
#82 - Oleg Roshupkin / @jjjahson

01/19/2011 at 08:20AM

12
#83 - xhtmlforum / @xhtmlforum

01/24/2011 at 08:41PM

12
#84 - Pavlo Klets / @p01nt

02/24/2011 at 09:15PM

12
#85 - vg / @vimgolfer

02/27/2011 at 09:37PM

12
#86 - Dragan Cvetinovic / @kawkafi

06/05/2011 at 09:52AM

12
#87 - (Emile (Swarts)) / @EmileSwarts

06/07/2011 at 09:38PM

12
#88 - Rolf Bjaanes / @rolfb

06/17/2011 at 01:43PM

12
#89 - not so punk :] / @notsopunk

06/19/2011 at 11:16AM

12
#90 - Tim Tsu / @vimgolfpunk

09/05/2011 at 04:10AM