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

519 active golfers, 2018 entries

Leaderboard (lowest score wins):
19
#391 - TchiKong / @tchikong

01/29/2011 at 12:33PM

19
#392 - Vernon Thommeret / @synotic

01/30/2011 at 06:15PM

19
#393 - Thom Hughes / @thom_hughes_1

03/28/2011 at 09:04AM

19
#394 - Adam Fraser / @Code_Post

02/29/2012 at 02:16AM

19
#395 - Joe Sullivan / @itsjoesullivan

06/20/2013 at 04:05AM

19
#396 - zmf_tim / @zmf_tim

08/31/2013 at 11:42PM

19
#397 - Matt Parnell / @parnmattdev

01/02/2014 at 11:19PM

19
#398 - CJ Avilla / @cjav_dev

05/12/2014 at 06:36PM

19
#399 - Rafee / @rafee_buet

07/22/2014 at 04:10PM

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

08/02/2014 at 06:46AM

19
#401 - Tj / @yrddy

08/19/2014 at 03:03AM

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

06/09/2015 at 01:28PM

19
#403 - Gerald Tilma / @GeraldTilma

10/17/2015 at 08:58PM

19
#404 - Kyouma / @kyoumaJohn

10/14/2016 at 07:10PM

19
#405 - Mike Bruno / @themike_bruno

10/23/2016 at 05:19AM

19
#406 - Mark Brody / @_markbrody

03/24/2017 at 02:59PM

19
#407 - Jonas Sunde V / @sunde_v

08/04/2017 at 05:32PM

19
#408 - Harsh Kumar / @datsleepyguy

09/09/2017 at 03:09PM

19
#409 - Markus Ditlev Olsen / @markusOlsen1

12/28/2023 at 09:45PM

19
#410 - Pablo Acuna / @pacuna

12/16/2024 at 09:55PM

20
#411 - Kevin Hamer / @khamer

01/05/2011 at 02:39PM

20
#412 - drio / @drio

01/11/2011 at 01:46PM

20
#413 - Avinash Baliga / @avinashbaliga

04/16/2011 at 02:16AM

20
#414 - Ian McCowan / @valrus

05/29/2011 at 09:32PM

20
#415 - Torben Rasmussen / @rasmustorben

08/29/2011 at 05:35PM

20
#416 - deadghost / @deadghosttt

01/12/2012 at 10:53AM

20
#417 - Fernando Axel Ellis / @Axel_Ellis

10/02/2013 at 09:50PM

20
#418 - n.st / @0013901644043f9

10/06/2013 at 04:26AM

20
#419 - Martin Chabot / @martinosis

12/10/2013 at 04:37PM

20
#420 - Patrick Pitoscia / @Patrick03960431

08/06/2014 at 02:34AM