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):
12
#121 - kemar / @le_kemar

08/27/2014 at 02:45PM

12
#122 - Johannes H. / @neVexa

10/28/2014 at 04:18PM

12
#123 - Jens Weggemann / @JensWeggemann

12/16/2014 at 08:03PM

12
#124 - ~Nicolas_Poulain / @nicolaspoulain

01/29/2015 at 10:50PM

12
#125 - mark0829 / @mark0829

02/04/2015 at 04:16AM

12
#126 - Janine Cheng / @janineist

02/13/2016 at 11:59AM

12
#127 - Dimitar Dimitrov / @kurkale6ka

03/16/2016 at 12:14PM

12
#128 - Pablo R. Dinella / @pablordinella

06/18/2016 at 07:36PM

12
#129 - TweetDreams / @TweetMusicians

10/16/2016 at 06:51AM

12
#130 - timerella® / @timerella

11/17/2016 at 10:59PM

12
#131 - Alex Linden / @alexwlinden1

04/25/2017 at 09:12PM

12
#132 - c0llision / @sh3llcode

02/07/2018 at 02:25PM

12
#133 - Chris Dean / @ChrisDe62379742

06/21/2018 at 01:59AM

12
#134 - Mihai / @mihaicristiant

12/23/2018 at 01:18PM

12
#135 - Chester Yap / @Chest_ErYap

07/20/2019 at 08:08PM

13
#136 - Paul King / @nrocy

01/01/2011 at 01:22AM

13
#137 - Josh Weinberg / @jcweinberg

01/01/2011 at 01:36AM

13
#138 - Steve Morrow / @yawmark

01/01/2011 at 02:30AM

13
#139 - Lee Marlow / @lmarlow

01/01/2011 at 04:01AM

13
#140 - Israel Chauca F. / @Raimondi

01/01/2011 at 11:09AM

13
#141 - h_east (トロッコ6個) / @h_east

01/01/2011 at 01:02PM

13
#142 - ninereeds / @ninereeds

01/01/2011 at 06:40PM

13
#143 - dominique pellé / @vimgolfisto

01/01/2011 at 09:49PM

13
#144 - Addisu Taddese / @azeey

01/01/2011 at 11:26PM

13
#145 - Fer Enaf / @0x00C0FFEE

01/01/2011 at 11:50PM

13
#146 - lionel young / @lionelyoung

01/02/2011 at 09:08AM

13
#147 - Leonard Chin / @lchin

01/03/2011 at 05:22AM

13
#148 - Adam Pohorecki / @apohorecki

01/03/2011 at 01:12PM

13
#149 - Karel Vervaeke / @karel1980

01/05/2011 at 09:17AM

13
#150 - Clive Evans / @swish_bob

01/13/2011 at 09:11PM