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):
15
#241 - Jacob Branaugh / @jacobbranaugh

06/25/2014 at 11:14PM

15
#242 - See BEAMs through walls / @hauleth

09/02/2014 at 10:28PM

15
#243 - Sabiki94@ブルスクの人 / @_jptomoya

10/18/2014 at 12:21PM

15
#244 - Rathrio / @Rathrio

11/16/2014 at 07:43PM

15
#245 - Innokenty Mikhailov / @gregolsent

01/28/2015 at 10:56AM

15
#246 - Ben Vandervalk / @benvvalk

09/27/2015 at 05:46AM

15
#247 - Mike Adams / @davis_cromwell

10/18/2015 at 01:36AM

15
#248 - Ian Trophy / @prfrgg

02/02/2016 at 07:36AM

15
#249 - Michał Dytko / @DytkoM

12/23/2016 at 02:12PM

15
#250 - Paul Draghicescu / @pdragy

03/22/2018 at 07:04AM

15
#251 - churaki / @churaki

02/06/2019 at 11:41AM

15
#252 - garry quested / @GQuested

09/20/2019 at 11:58AM

16
#253 - Paul Paradise / @natacado

12/31/2010 at 11:45PM

16
#254 - Asmund / @herrasbe

01/01/2011 at 07:04AM

16
#255 - Christopher Sexton / @crsexton

01/02/2011 at 03:21AM

16
#256 - optixx / @optixx

01/04/2011 at 12:10PM

16
#257 - Michael Søndergaard / @Sheeo

01/05/2011 at 09:27AM

16
#258 - Ryan Kanno / @ryankanno

01/07/2011 at 01:13AM

16
#259 - Francisco Dibar / @frandibar

01/08/2011 at 03:01AM

16
#260 - Sailesh Mittal / @saileshmittal

01/15/2011 at 05:07AM

16
#261 - Matthieu Honel / @ocus

01/28/2011 at 12:55AM

16
#262 - Frederik Mogensen / @fmogensen

03/30/2011 at 11:28PM

16
#263 - Shawn / @sartak

04/23/2011 at 07:24PM

16
#264 - Wojciech Pietrzak / @astropanic

06/07/2011 at 07:20PM

16
#265 - Stuart Gale / @bishboria

06/11/2011 at 11:53PM

16
#266 - Kevin Munc / @muncman

06/17/2011 at 03:54AM

16
#267 - sebtyp / @sebtyp

12/15/2011 at 09:19PM

16
#268 - ajt / @acfortran

01/31/2012 at 05:15PM

16
#269 - Kyle Fuller / @kylefuller

04/15/2012 at 07:37PM

16
#270 - wes / @_weslly

07/16/2012 at 04:54PM