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

444 active golfers, 1643 entries

Leaderboard (lowest score wins):
11
#31 - kimber gonzalez / @kimberlycreates

01/13/2015 at 10:16PM

11
#32 - Raj / @brshenoy

04/26/2015 at 02:52AM

11
#33 - Baleja McIntee / @0mcinteeq

06/09/2015 at 01:53PM

11
#34 - T A / @SirAviles

08/31/2015 at 08:29PM

11
#35 - ardila.d.ardila / @ardiladardila1

10/02/2015 at 04:43PM

11
#36 - Walker Boh / @walker_boh

10/12/2015 at 09:30AM

11
#37 - Wilmer Bandres / @WilmerBandres

12/29/2015 at 07:51PM

11
#38 - Jon Krause / @jkrause314

01/13/2016 at 09:02PM

11
#39 - Aleksey Zhidkov / @AlexeyZhidkov

02/25/2016 at 05:07AM

11
#40 - trx / @trxdbg

10/26/2016 at 01:40PM

11
#41 - Saki Gw / @Sakigw

12/14/2016 at 08:32PM

11
#42 - Zhihong Liu / @pieapple03

02/28/2017 at 03:40PM

11
#43 - setNull / @dadaojiemo

03/01/2017 at 01:49AM

11
#44 - sijinyuan / @sijinyuan

03/04/2017 at 12:25PM

11
#45 - Bennett Bernardoni / @BBernardoni

07/03/2017 at 09:16PM

11
#46 - 杨洋 / @176795444

07/16/2017 at 10:41AM

11
#47 - Turkey Man / @lvturkeyman

11/19/2017 at 04:46AM

11
#48 - BarbaJol / @drpproteus

01/01/2018 at 10:38AM

11
#49 - DHM / @DHM29978992

04/28/2018 at 03:27PM

11
#50 - Daniël De Koker / @daniel_koker

07/04/2018 at 08:35PM

11
#51 - Dax / @zacoxi

11/16/2018 at 07:49AM

11
#52 - alekfed / @alek_fed

04/15/2019 at 07:24PM

11
#53 - majo senf / @majo_senf

06/21/2019 at 09:04AM

11
#54 - Cassandra / @kascein

09/17/2019 at 10:07PM

11
#55 - Brandon Harrison / @llAboutB

09/25/2019 at 03:24PM

11
#56 - vimgolfer / @vimgolfer7

10/22/2019 at 05:04AM

11
#57 - Melvin Cheung / @MelvinCheung

11/11/2019 at 07:05PM

11
#58 - Miłosz Łakomy / @foobar01123

11/22/2019 at 10:48AM

12
#59 - Nándor Komzák / @rubymood

01/01/2011 at 02:52AM

12
#60 - Matthew Draper / @_matthewd

01/01/2011 at 03:02AM