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

624 active golfers, 1837 entries

Leaderboard (lowest score wins):
14
#241 - Remi Bernotavicius / @bobbobbio

07/18/2014 at 03:13AM

14
#242 - Pete Johns / @johnsyweb

07/20/2014 at 02:36AM

14
#243 - Joey Twiddle / @joeytwiddle

07/20/2014 at 07:12PM

14
#244 - Leon Moll / @MeonLoll

07/21/2014 at 12:24PM

14
#245 - Frank Dinoff / @FDinoff

07/25/2014 at 01:53AM

14
#246 - Peter Strawson / @PeterStrawson

08/04/2014 at 02:06AM

14
#247 - PLS / @jaegd

08/05/2014 at 09:55PM

14
#248 - April Gentle / @chen327684096

08/26/2014 at 03:54PM

14
#249 - Michael Comerford / @MComerford1

09/17/2014 at 01:14AM

14
#250 - Bob Davison / @bobd91

09/23/2014 at 08:28PM

14
#251 - simonced / @simonced

09/28/2014 at 03:14AM

14
#252 - Narek / @NarekCat

10/10/2014 at 07:37PM

14
#253 - Eduardo / @earada

10/22/2014 at 03:42PM

14
#254 - Mauro Persano / @fzort

11/15/2014 at 07:39PM

14
#255 - Matthieu Crapet / @mcr05

11/26/2014 at 10:30AM

14
#256 - Test User / @TestUserIgnore

12/04/2014 at 09:50PM

14
#257 - Josu Oyanguren / @josuoyanguren

12/18/2014 at 04:39PM

14
#258 - Filipe Almeida / @filipe_almeida

12/31/2014 at 09:34AM

14
#259 - Carlos A HenrĂ­quez Q / @lagunex

01/18/2015 at 06:18PM

14
#260 - mark0829 / @mark0829

01/25/2015 at 01:42PM

14
#261 - no name / @vimgol

01/28/2015 at 06:35PM

14
#262 - xieyh11 / @xieyh11

02/16/2015 at 02:55AM

14
#263 - Naseem Al-Naji / @NaseemAlnaji

02/19/2015 at 09:53PM

14
#264 - Thiago Prado / @5k1pp3r

02/22/2015 at 01:11PM

14
#265 - Harold Pong / @har2po

02/26/2015 at 10:54AM

14
#266 - Raja Sharan Mamidala / @rajasharan

03/02/2015 at 03:33AM

14
#267 - Ala' Ibrahim / @alaa_ibrahim

03/10/2015 at 10:11AM

14
#268 - pftb12345 / @pftb12345

03/30/2015 at 12:39PM

14
#269 - ipson_nek / @ipson_nek

03/30/2015 at 03:29PM

14
#270 - Paul Diaconescu / @paulgtd

04/09/2015 at 06:39AM