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):
11
#61 - A A A / @37fatos

01/21/2021 at 01:22AM

11
#62 - lydxn / @lydxn1

07/25/2021 at 11:08PM

11
#63 - Flimsy Giraffe / @flimsy_giraffe

12/01/2021 at 03:52AM

11
#64 - blabla zincou / @BZincou

03/24/2022 at 08:19PM

11
#65 - russellzhaomao / @russellzhaomao

05/25/2022 at 04:16AM

11
#66 - Qing Liu / @poeminlash

07/31/2022 at 04:38AM

11
#67 - Janzen / @__Coos

09/23/2022 at 11:24AM

11
#68 - 刘宏亮 / @AkeyCoy

09/25/2022 at 02:31AM

11
#69 - MC / @MC88686523

03/25/2023 at 02:39PM

11
#70 - Laurens De la Marche / @LaurensDLM

10/18/2023 at 01:56PM

11
#71 - Remus Dalrymple / @bornintheflames

12/13/2023 at 08:49PM

11
#72 - moh ayaya / @AyayaMoh

03/02/2024 at 05:41PM

11
#73 - Peppa Pig / @PeppaPigSg

08/14/2024 at 10:11AM

11
#74 - nickGPT / @nickandbro

08/28/2024 at 11:31PM

11
#75 - Suhaib Murshid / @suhaibm

08/29/2024 at 04:23PM

11
#76 - Eran / @RedSponge

11/08/2024 at 05:08PM

12
#77 - Nándor Komzák / @rubymood

01/01/2011 at 02:52AM

12
#78 - Matthew Draper / @_matthewd

01/01/2011 at 03:02AM

12
#79 - Alain Gilbert / @alain_gilbert

01/01/2011 at 03:40AM

12
#80 - Brad / @bjjwillis

01/01/2011 at 11:38AM

12
#81 - Prody / @Prody225

01/01/2011 at 03:42PM

12
#82 - Ricardo Mendes / @locks

01/01/2011 at 04:03PM

12
#83 - Wei Dai / @clvv42

01/01/2011 at 09:55PM

12
#84 - Renaud Morvan / @neleanth

01/01/2011 at 10:08PM

12
#85 - rabidpraxis / @rabidpraxis

01/01/2011 at 11:12PM

12
#86 - Akira Matsuda / @a_matsuda

01/02/2011 at 03:37PM

12
#87 - Tien Le / @tienlex

01/02/2011 at 06:33PM

12
#88 - Corey Purcell / @coreypurcell

01/03/2011 at 02:47PM

12
#89 - Benoît Ryder / @benoitryder

01/03/2011 at 10:22PM

12
#90 - Clément Nodet / @clementnodet

01/03/2011 at 10:27PM