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
#61 - Renaud Morvan / @neleanth

01/01/2011 at 10:08PM

12
#62 - rabidpraxis / @rabidpraxis

01/01/2011 at 11:12PM

12
#63 - Akira Matsuda / @a_matsuda

01/02/2011 at 03:37PM

12
#64 - Tien Le / @tienlex

01/02/2011 at 06:33PM

12
#65 - Corey Purcell / @coreypurcell

01/03/2011 at 02:47PM

12
#66 - Benoît Ryder / @benoitryder

01/03/2011 at 10:22PM

12
#67 - Clément Nodet / @clementnodet

01/03/2011 at 10:27PM

12
#68 - aaaa3331 / @aaaa3331

01/03/2011 at 10:47PM

12
#69 - Aaron Bull Schaefer / @elasticdog

01/05/2011 at 12:03AM

12
#70 - oliboli / @oliboliboli

01/06/2011 at 11:17AM

12
#71 - Ujjwol Lamichhane / @Ujjwol

01/07/2011 at 10:19AM

12
#72 - derp derp / @derp__

01/09/2011 at 03:32AM

12
#73 - Pablo Villalba / @micho

01/09/2011 at 03:41PM

12
#74 - Toto l'haricot / @nico_le_terribl

01/09/2011 at 06:52PM

12
#75 - Balkoth / @_Balkoth_

01/09/2011 at 08:38PM

12
#76 - Agus Lopez / @aguslr

01/10/2011 at 10:51PM

12
#77 - Eivind Jahren / @HaskellElephant

01/17/2011 at 03:47PM

12
#78 - Oleg Roshupkin / @jjjahson

01/19/2011 at 08:20AM

12
#79 - xhtmlforum / @xhtmlforum

01/24/2011 at 08:41PM

12
#80 - Pavlo Klets / @p01nt

02/24/2011 at 09:15PM

12
#81 - vg / @vimgolfer

02/27/2011 at 09:37PM

12
#82 - Dragan Cvetinovic / @kawkafi

06/05/2011 at 09:52AM

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

06/07/2011 at 09:38PM

12
#84 - Rolf Bjaanes / @rolfb

06/17/2011 at 01:43PM

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

06/19/2011 at 11:16AM

12
#86 - Tim Tsu / @vimgolfpunk

09/05/2011 at 04:10AM

12
#87 - kjrn / @kjrnleto

10/06/2011 at 07:22PM

12
#88 - p0ckets / @p0ckets

10/07/2011 at 09:02PM

12
#89 - Milan Dobrota / @milandobrota

11/21/2011 at 04:28AM

12
#90 - William Dunand / @wdunand

11/24/2011 at 09:19AM