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):
19
#361 - Mike Bruno / @themike_bruno

10/23/2016 at 05:19AM

19
#362 - Mark Brody / @_markbrody

03/24/2017 at 02:59PM

19
#363 - Jonas Sunde V / @sunde_v

08/04/2017 at 05:32PM

19
#364 - Harsh Kumar / @datsleepyguy

09/09/2017 at 03:09PM

20
#365 - Kevin Hamer / @khamer

01/05/2011 at 02:39PM

20
#366 - drio / @drio

01/11/2011 at 01:46PM

20
#367 - Avinash Baliga / @avinashbaliga

04/16/2011 at 02:16AM

20
#368 - Ian McCowan / @valrus

05/29/2011 at 09:32PM

20
#369 - Torben Rasmussen / @rasmustorben

08/29/2011 at 05:35PM

20
#370 - deadghost / @deadghosttt

01/12/2012 at 10:53AM

20
#371 - Fernando Axel Ellis / @Axel_Ellis

10/02/2013 at 09:50PM

20
#372 - n.st / @0013901644043f9

10/06/2013 at 04:26AM

20
#373 - Martin Chabot / @martinosis

12/10/2013 at 04:37PM

20
#374 - Patrick Pitoscia / @Patrick03960431

08/06/2014 at 02:34AM

20
#375 - luffy / @raxcoi

06/06/2015 at 08:45PM

20
#376 - Nicola Coretti / @NiCoRetti

06/04/2016 at 08:46AM

20
#377 - Gurukandhamoorthi / @Gurukandhamoor1

07/13/2017 at 08:58AM

21
#378 - Corbin Simpson / @corbinsimpson

01/02/2011 at 02:41PM

21
#379 - James Freed / @JamesTFreed

02/03/2012 at 02:22AM

21
#380 - Joseph J. Piché / @jjpiche

08/25/2012 at 02:10AM

21
#381 - Nicolas Friedli / @NicolasFriedli

10/30/2012 at 02:14PM

21
#382 - Boer Asten / @astenboer

11/08/2012 at 02:58AM

21
#383 - Alex Hammel / @AlexJHammel

12/23/2012 at 06:32PM

21
#384 - Zach Kemp / @zvksf

12/19/2013 at 05:28PM

21
#385 - Mikael Saltzman / @MikaelSaltzman

10/04/2015 at 01:33AM

22
#386 - Franco Lazzarino / @flazz

01/04/2011 at 09:06PM

22
#387 - bestform / @bestform

02/12/2011 at 10:32PM

22
#388 - Mathias Fussenegger / @mfussenegger

06/06/2011 at 09:30PM

22
#389 - Domon / @Domon

09/11/2012 at 09:57AM

22
#390 - Bart of Denver / @bartofdenver

08/12/2013 at 10:27PM