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

Leaderboard (lowest score wins):
18
#331 - pete / @peteches

02/23/2014 at 04:02PM

18
#332 - Hanakun. / @akunohanaKUN

10/21/2014 at 05:56AM

18
#333 - ぷりケツにるぽ / @nillpo

01/05/2015 at 01:24PM

18
#334 - SilentFl / @Silent_Fl

01/27/2015 at 01:53PM

18
#335 - ɐʇnɥsɐpoʇ / @todashuta

03/26/2015 at 07:02AM

18
#336 - 親の金でシャンプーを買うな / @jajkeqos

04/08/2015 at 02:47PM

18
#337 - Chenut Ludovic / @7Brwa7

03/30/2016 at 08:04PM

18
#338 - Ben Hill / @KaizenSoze70

05/10/2016 at 04:50PM

18
#339 - Austin Ware / @AustinWare17

03/13/2018 at 02:06AM

18
#340 - Ivo Blöchliger / @aigledesalpes

08/14/2019 at 06:28PM

18
#341 - Ariel Miculas / @ArielMiculas

09/24/2019 at 02:38PM

19
#342 - Henri Bourcereau / @mmai

01/01/2011 at 08:08PM

19
#343 - Glenn / @spamcow_moo

01/03/2011 at 11:45PM

19
#344 - David Duponchel / @dduponchel

01/08/2011 at 10:13PM

19
#345 - Philipp / @klmann232

01/10/2011 at 12:21AM

19
#346 - TchiKong / @tchikong

01/29/2011 at 12:33PM

19
#347 - Vernon Thommeret / @synotic

01/30/2011 at 06:15PM

19
#348 - Thom Hughes / @thom_hughes_1

03/28/2011 at 09:04AM

19
#349 - Adam Fraser / @Code_Post

02/29/2012 at 02:16AM

19
#350 - Joe Sullivan / @itsjoesullivan

06/20/2013 at 04:05AM

19
#351 - Timothée Gauthier / @zmf_tim

08/31/2013 at 11:42PM

19
#352 - Matt Parnell / @parnmattdev

01/02/2014 at 11:19PM

19
#353 - w1zeman1p / @wizemanip

05/12/2014 at 06:36PM

19
#354 - Rafee / @rafee_buet

07/22/2014 at 04:10PM

19
#355 - かしゅーなっつ@修行中 / @kashew_nuts

08/02/2014 at 06:46AM

19
#356 - Tj / @yrddy

08/19/2014 at 03:03AM

19
#357 - João Pedro Foscarini / @FoscariniJoao

06/09/2015 at 01:28PM

19
#358 - Gerald Tilma / @GeraldTilma

10/17/2015 at 08:58PM

19
#359 - Kyouma / @kyoumaJohn

10/14/2016 at 07:10PM

19
#360 - Mike Bruno / @themike_bruno

10/23/2016 at 05:19AM