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):
25
#421 - Charles Neill / @ccneill

05/01/2014 at 02:09AM

25
#422 - Justin Knag / @justinknag

08/30/2014 at 12:04AM

25
#423 - Jonas Ng / @jnshey

05/16/2015 at 09:46AM

25
#424 - Thongrapee / @kulaspa2

07/25/2016 at 05:43AM

25
#425 - Stefan Sonski / @stefansonski

08/23/2016 at 03:24PM

26
#426 - Viswanath Sivakumar / @viswanathgs

08/30/2012 at 03:30PM

26
#427 - Brent Woo / @BrentPWoo

10/01/2018 at 09:00PM

26
#428 - ~ben / @nebsirrah

02/06/2019 at 06:04PM

27
#429 - Sanchez Benjamin / @Sanchezsky

11/11/2011 at 12:20PM

27
#430 - John Hilliard / @praetorian

01/31/2012 at 04:03AM

27
#431 - Bjorn / @bjorn_248

11/15/2013 at 09:08PM

27
#432 - Dorian Scheidt / @DorianListens

02/25/2015 at 05:02AM

27
#433 - Roger Spencer / @RojSpencer

03/12/2015 at 11:16PM

29
#434 - Nick Nisi / @nicknisi

05/05/2012 at 03:17AM

29
#435 - Adam Licht / @aal85255

10/22/2013 at 03:38AM

30
#436 - Bryan Kendall / @bkendall

06/09/2011 at 04:01PM

31
#437 - sorami / @boredoms

05/01/2011 at 12:02AM

35
#438 - Alpa_akm / @Alpa_akm

07/28/2017 at 11:10AM

37
#439 - TimWolla / @TimWolla

03/13/2014 at 09:48PM

39
#440 - Lorenz / @lorenzk

01/10/2011 at 09:15PM

244
#441 - Sven Koesling / @McSvenster

08/20/2012 at 02:39PM