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

442 active golfers, 1636 entries

Leaderboard (lowest score wins):
17
#301 - Mathieu ELIE / @mathieuel

03/25/2011 at 12:09AM

17
#302 - Tomasz Zurkowski / @doriath88

04/07/2011 at 09:10AM

17
#303 - Dave / @zzdave13

07/26/2011 at 06:14PM

17
#304 - Stephen Gordon / @DubsGordon

08/02/2011 at 02:44AM

17
#305 - Nelson M. Haraguchi / @nelsonmhjr

09/04/2011 at 07:13PM

17
#306 - jasper110 / @jasper110

09/22/2011 at 09:04AM

17
#307 - Anders H. Madsen / @andershellerup

01/03/2012 at 01:41AM

17
#308 - Aaron Bieber / @aaronbieber

07/17/2013 at 11:25PM

17
#309 - Alexey Shmalko / @RasenDubi

11/04/2013 at 05:19PM

17
#310 - Jonas K. / @geratheon

02/01/2014 at 03:54PM

17
#311 - asdf / @201679996

03/08/2014 at 12:03PM

17
#312 - Mick Garvey / @blarko

04/24/2014 at 05:08PM

17
#313 - Alan Sherman / @InfoLeak117

06/03/2014 at 09:43PM

17
#314 - Ram Tamtam / @ramtamtamtam

06/30/2014 at 09:45AM

17
#315 - Kristof Vannotten / @kristofv

09/08/2014 at 07:29PM

17
#316 - Maxime / @Maxime_VII

06/24/2015 at 02:51PM

17
#317 - Andrew Michaud / @andrewjmichaud

09/04/2015 at 08:52PM

17
#318 - Levon Tarver / @LevonTarver

04/20/2016 at 12:17PM

17
#319 - Bogumił Kamiński / @BogumilKaminski

05/01/2016 at 09:48PM

17
#320 - Brian Hall / @_bruab_

06/01/2017 at 01:32PM

17
#321 - Paul Inc / @hiniol1982

09/17/2017 at 01:48PM

18
#322 - emmanuel delgado / @chischaschos

01/01/2011 at 08:36AM

18
#323 - Ben Lenarts / @benlenarts

01/02/2011 at 10:43PM

18
#324 - Randall Bohn / @rsbohn

11/25/2011 at 08:25PM

18
#325 - Christopher Brew / @Seph1rothVII

01/17/2012 at 10:16PM

18
#326 - Arto Vuori / @dhpe

09/01/2012 at 06:11PM

18
#327 - Matt Robbins / @mcrmfc

07/16/2013 at 08:25AM

18
#328 - engy / @engydmw

09/25/2013 at 09:21PM

18
#329 - Robert Rosolek / @robertrosolek

10/18/2013 at 08:52AM

18
#330 - Eric Potter / @pottereric

12/20/2013 at 02:57PM