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

661 active golfers, 1975 entries

Leaderboard (lowest score wins):
15
#361 - Thomas Larrieu / @t_larrieu

01/29/2015 at 05:41PM

15
#362 - Rathrio / @Rathrio

02/01/2015 at 02:28AM

15
#363 - César Enrique / @caenrique93

02/03/2015 at 11:49PM

15
#364 - Martin Liberg / @marreman

02/08/2015 at 05:15PM

15
#365 - Jonathan Martindell / @jonmartindell

02/27/2015 at 09:17PM

15
#366 - Mariano Macchi / @mmacchif

03/02/2015 at 04:25PM

15
#367 - Elizabeth / @sprinkles418

03/03/2015 at 05:58PM

15
#368 - David English / @Nglish26

03/27/2015 at 09:07PM

15
#369 - Cosmin Banu / @cosminb82

05/07/2015 at 09:40PM

15
#370 - David Stensland / @DavidStensland

06/11/2015 at 08:43PM

15
#371 - alex / @alexAngle8

08/23/2015 at 03:52PM

15
#372 - Walker Boh / @walker_boh

10/05/2015 at 08:42AM

15
#373 - Gerald Tilma / @GeraldTilma

10/18/2015 at 04:21PM

15
#374 - roboguy / @roboguy

10/18/2015 at 09:50PM

15
#375 - Pete Sevander / @Sevanteri

11/12/2015 at 12:14PM

15
#376 - emblox / @emblox

11/19/2015 at 11:12PM

15
#377 - fuck GFW / @ravishGFW

01/05/2016 at 04:52AM

15
#378 - Cristian Lupașcu / @clupasq

02/08/2016 at 12:42PM

15
#379 - Benjamin Miller / @Bmiller14Miller

03/01/2016 at 03:09PM

15
#380 - Vladimir Bauer / @vbauerster

03/05/2016 at 06:48PM

15
#381 - glepha / @glepha_vim

03/16/2016 at 04:12AM

15
#382 - Keri Volans / @KeriVolans

04/03/2016 at 10:41AM

15
#383 - Jason Pleau / @JasonPleau

05/06/2016 at 02:02AM

15
#384 - Kenny Lau / @kkkennnny

06/02/2016 at 08:53AM

15
#385 - malet / @Malet

06/24/2016 at 10:35PM

15
#386 - Quatrix / @Quatrix

08/10/2016 at 09:52PM

15
#387 - イーサン / @metakirby5

08/18/2016 at 10:57PM

15
#388 - hor1ace / @hor3ace

09/09/2016 at 06:55PM

15
#389 - Jonathan Elliott / @jon__elliott

11/02/2016 at 05:51PM

15
#390 - Michał Dytko / @DytkoM

12/21/2016 at 09:25AM