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):
22
#391 - ggdGiBork:3^[:wq / @CopperBadger

10/06/2015 at 02:18AM

22
#392 - Phoon / @justflashhim

05/11/2019 at 03:56PM

23
#393 - Guillaume Bonnoron / @gbonnoron

01/01/2011 at 04:15PM

23
#394 - Jeroen / @teranex

03/01/2011 at 08:20PM

23
#395 - Gonzih / @Gonzih

03/24/2011 at 09:03PM

23
#396 - Shannon / @shannonskipper

11/26/2011 at 04:51AM

23
#397 - Tyler Breisacher / @tbreisacher

08/25/2012 at 08:33AM

23
#398 - Michael / @patheticpat

12/16/2012 at 07:23PM

23
#399 - Brian Besmanoff / @BrianBesmanoff

07/26/2013 at 02:01AM

23
#400 - wilddog64 / @chengkai318

12/17/2013 at 08:39PM

23
#401 - Alessandro Lisander / @wuiimu

01/05/2014 at 02:05AM

23
#402 - Almog / @almog

03/11/2014 at 01:38PM

23
#403 - Felipe Jaramillo F / @mrfelipe

04/02/2014 at 01:53PM

24
#404 - johan wester / @wester87

11/12/2011 at 02:42PM

24
#405 - Jyun-Fan Tsai / @fakecolor

02/04/2012 at 01:41PM

24
#406 - Jason Wolf / @zephyr_wolf

11/08/2012 at 01:24PM

24
#407 - Nico Kruger / @nicok_za

11/09/2012 at 12:01PM

24
#408 - Eric Andres / @eric_m_andres

12/05/2012 at 06:01PM

24
#409 - Oliver Christ / @0liverChrist

09/25/2013 at 04:00PM

24
#410 - Sam Burk / @smwbk

12/23/2013 at 03:02AM

24
#411 - Vincent Dumoulin / @dumoulinv

11/23/2014 at 05:31AM

24
#412 - d1uckym d1uckym / @d1uckym

02/16/2015 at 06:53AM

24
#413 - quiggy­čî╣ / @quiggy

05/19/2016 at 07:41PM

24
#414 - Brandon Height / @Lask0x

08/08/2017 at 05:07PM

24
#415 - Daniel de Vries / @devries_d

02/14/2018 at 04:04PM

24
#416 - Jurica / @Jurica34581259

11/16/2018 at 04:26PM

25
#417 - Jan B. / @bracki

01/03/2011 at 04:49PM

25
#418 - David Wilemski / @davidwilemski

06/09/2011 at 06:37PM

25
#419 - Joe T / @h2g2guy

11/01/2013 at 05:31AM

25
#420 - ren / @wxoc

02/25/2014 at 10:06AM