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, 1624 entries

Leaderboard (lowest score wins):
13
#151 - Lauri Tirkkonen / @lotheac

07/01/2011 at 09:42PM

13
#152 - Øystein Walle / @oysteinwalle

07/04/2011 at 06:46PM

13
#153 - Hannibal7878 / @Hannibal7878

07/11/2011 at 02:21PM

13
#154 - Justin Love / @wondible

07/16/2011 at 01:02PM

13
#155 - sjatkinson / @sjatkinson

08/30/2011 at 02:55AM

13
#156 - Burkhard Zimmermann / @BurkZimm

01/02/2012 at 01:13AM

13
#157 - maxthoursie / @maxthoursie

01/30/2012 at 07:39PM

13
#158 - Kurt Gaastra / @KGaastra

02/14/2012 at 05:49AM

13
#159 - Ibrahim Tencer / @ibrahimtencer

02/16/2012 at 06:21AM

13
#160 - oliver mueller / @marcontwit

02/26/2012 at 08:38AM

13
#161 - arno renevier / @dadadiblog

03/18/2012 at 06:18PM

13
#162 - Kerson Hsiao / @KersonHsiao

07/15/2012 at 10:21AM

13
#163 - Javier Cervantes / @solojavier

08/31/2012 at 10:25PM

13
#164 - G. Ahtune / @gahtune

11/07/2012 at 02:21PM

13
#165 - mnx / @mnxx

07/08/2013 at 03:37PM

13
#166 - brett / @brettyukich

09/21/2013 at 09:33PM

13
#167 - Sntano Euhsk / @SEuhsk

06/04/2014 at 12:35AM

13
#168 - Jose Gutierrez / @Jogusa

10/22/2014 at 03:54PM

13
#169 - eBrnd / @eBrnd

11/03/2014 at 06:27PM

13
#170 - deris / @deris0126

11/07/2014 at 10:25AM

13
#171 - Matt / @mcr05

12/29/2014 at 05:12PM

13
#172 - pftb12345 / @pftb12345

04/07/2015 at 12:33PM

13
#173 - Jeremiah Goyette / @JeremiahGoyette

08/03/2016 at 06:18AM

13
#174 - Pierre Maoui / @poupougnac

12/29/2016 at 05:55PM

13
#175 - Daniel / @Daniel00288663

03/30/2017 at 01:28PM

14
#176 - xer0x / @xer0x

01/01/2011 at 12:43AM

14
#177 - Douglas Stockwell / @dstockwell

01/01/2011 at 02:28AM

14
#178 - Pierre / @Pihour

01/01/2011 at 03:00AM

14
#179 - Mattiassich Ákos / @mattiassicha

01/01/2011 at 03:23PM

14
#180 - Kamil Yurtsever / @y313

01/03/2011 at 10:47PM