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 536cfa23fcccd100025678bd

Extract argument from function

The aim is to see if you can do some refactoring very fast.

Start file
attr("y",function(v){return v})
End file
f=function(v){return v};
attr("y",f)

View Diff

1c1,2
< attr("y",function(v){return v})
---
> f=function(v){return v};
> attr("y",f)

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 754 remaining solutions by signing in and submitting your own entry
#755 BitLad / @BitLad - Score: 30 - 01/31/18 @ 18:37
veeeexo<Esc>paf)<Esc>kIf=<Esc>A;<Esc>hx:w<CR>:wq<CR>

0 comments


Created by: @EdgarHipp

755 active golfers, 2364 entries

Leaderboard (lowest score wins):
13
#61 - Vito / @GodFather

07/06/2014 at 04:54AM

13
#62 - Nico Lehmann / @nilehmann

07/06/2014 at 06:07PM

13
#63 - Lasse Dalegaard / @ldalegaard

07/06/2014 at 09:44PM

13
#64 - Caek / @Caek_

07/14/2014 at 02:50AM

13
#65 - Siddhanathan S. / @siddhanathan

07/15/2014 at 06:00PM

13
#66 - joomy / @cattheory

07/20/2014 at 07:02PM

13
#67 - Oleg Tsymbalyuk / @oleg_tc

07/21/2014 at 05:28AM

13
#68 - Birkir Ólafsson / @Birkirlafsson

07/21/2014 at 06:00PM

13
#69 - Dominik Szerszeń / @DominikSze

07/22/2014 at 10:47AM

13
#70 - Yoonho Lee / @ID_einet89

07/23/2014 at 10:16AM

13
#71 - Alexey Permyakov / @aplexey

07/26/2014 at 06:06PM

13
#72 - Omer Lachish / @rauchy

07/27/2014 at 01:12PM

13
#73 - Amir Kremer / @AmirKremer

07/27/2014 at 01:13PM

13
#74 - Rails Girls Tel-Aviv / @RailsGirlsTLV

07/27/2014 at 01:28PM

13
#75 - Slartibartfast / @S_Bartfast

07/31/2014 at 12:16PM

13
#76 - T / @tea_sea

08/01/2014 at 04:10PM

13
#77 - Stefan Schmidt / @stafue

08/08/2014 at 01:45PM

13
#78 - Ben Haines / @bhainesva

08/08/2014 at 05:44PM

13
#79 - Ky Statham / @ijustwannacode

08/12/2014 at 07:05PM

13
#80 - Phil Dubach / @fuiru

08/13/2014 at 06:24AM

13
#81 - Roman Charushin / @lompee

08/15/2014 at 12:57PM

13
#82 - Phil Runninger / @PhilRunninger

08/18/2014 at 06:26PM

13
#83 - booom / @ateukme

08/18/2014 at 09:24PM

13
#84 - Bill Booth / @ohiopyle

08/20/2014 at 02:09AM

13
#85 - Vim Golfer / @golfing_vim

08/24/2014 at 12:23PM

13
#86 - Ryan / @murftown

09/02/2014 at 05:55AM

13
#87 - @hauleth@hauleth.dev / @hauleth

09/02/2014 at 10:08PM

13
#88 - John Smith / @literacyisgood

09/05/2014 at 06:35AM

13
#89 - Jonas / @j0na3

09/11/2014 at 10:13PM

13
#90 - Aaron Fresh / @AaronFresh7

09/13/2014 at 06:49AM