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

443 active golfers, 1642 entries

Leaderboard (lowest score wins):
16
#271 - wes / @_weslly

07/16/2012 at 04:54PM

16
#272 - Reed Riley / @ReedRile

08/14/2012 at 04:49PM

16
#273 - vansan / @VinceVansan

08/21/2012 at 09:20PM

16
#274 - Panupan S. / @lionpeal

01/16/2013 at 12:39AM

16
#275 - RobertT / @techrt2050

07/10/2013 at 10:00AM

16
#276 - Woojung Kim 김우중 / @_kimwz

07/13/2013 at 12:24AM

16
#277 - powertomato / @powertomato

07/22/2013 at 11:58AM

16
#278 - Hachez Floran / @FloranHachez

09/04/2013 at 08:55AM

16
#279 - nona urbiz / @nospampleasemam

09/28/2013 at 10:04AM

16
#280 - foo / @foo88832727

10/18/2013 at 04:11PM

16
#281 - Domingue Justin / @_jdomingue

12/30/2013 at 04:56PM

16
#282 - Daniel Jonsson / @DanielJonss

01/21/2014 at 04:56PM

16
#283 - Patrick Oscity / @der_padde

02/10/2014 at 01:48AM

16
#284 - Timothy Lin / @lzh9102

03/08/2014 at 03:58AM

16
#285 - Solar Powered Robot / @moskrin

05/01/2014 at 01:53PM

16
#286 - Kyle Travis / @kmakai

05/16/2014 at 06:47PM

16
#287 - r. / @rmarvie

12/19/2014 at 10:17PM

16
#288 - Aaron Whittington / @whittaaron

01/16/2015 at 04:20AM

16
#289 - merphant / @merphant

10/24/2015 at 06:19AM

16
#290 - Etienne Tremel / @etiennetremel

02/20/2016 at 08:51PM

16
#291 - Ron Alexssen / @Ralexhere

10/13/2017 at 10:17PM

16
#292 - name / @name65894813

11/23/2018 at 09:57PM

17
#293 - michael caviness / @michaelmichael

01/02/2011 at 02:06AM

17
#294 - Pete Johns / @johnsyweb

01/02/2011 at 06:13AM

17
#295 - Greg Haygood / @greghaygood

01/02/2011 at 04:42PM

17
#296 - James Cash / @jamesnvc

01/02/2011 at 07:16PM

17
#297 - Rune Botten / @runeb

01/02/2011 at 08:44PM

17
#298 - Thomas Schönwälder / @Masei1988

01/12/2011 at 03:23PM

17
#299 - Andrey A. Ugolnik / @andreyugolnik

01/19/2011 at 07:13PM

17
#300 - coolspot / @sa_plart

01/26/2011 at 09:36PM