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

646 active golfers, 1921 entries

Leaderboard (lowest score wins):
15
#331 - Apostolis Hardalias / @hardalias

05/24/2014 at 12:18PM

15
#332 - Justin Weidner / @justinweidner

05/27/2014 at 03:26PM

15
#333 - Quota / @Quotad

05/30/2014 at 07:34AM

15
#334 - Augusto Pascutti / @augustohp

06/02/2014 at 09:36PM

15
#335 - heron bird / @urzonn1

06/05/2014 at 10:36PM

15
#336 - Russ Adams / @rustushki

06/07/2014 at 01:30PM

15
#337 - Tim Seyschab / @SeyschabTim

06/12/2014 at 07:37PM

15
#338 - Vinicius Souza / @vsouzas

06/14/2014 at 05:46PM

15
#339 - Jeffrey Klein / @jeffwklein

06/16/2014 at 06:56PM

15
#340 - TapTemplate / @TapTemplate

06/28/2014 at 01:58AM

15
#341 - sergio filho / @sergio3010

07/15/2014 at 02:57AM

15
#342 - Joakim Hansen / @gnofs

07/31/2014 at 12:50PM

15
#343 - Oliver Christ / @0liverChrist

08/04/2014 at 09:12PM

15
#344 - Seth Rader / @f4uLT

08/12/2014 at 11:48PM

15
#345 - Ingolf / @bl4ckb1rd_LE

08/30/2014 at 10:42AM

15
#346 - Dr4k3 / @Dr4k3_LE

08/30/2014 at 10:51AM

15
#347 - JForstreuter / @JForstr

10/06/2014 at 02:28PM

15
#348 - Nicholas Lee-Hone / @NicholasLeeHone

10/14/2014 at 03:21PM

15
#349 - eBrnd / @eBrnd

11/02/2014 at 12:36PM

15
#350 - Erik Buček / @_EnterNameHere_

11/26/2014 at 03:18PM

15
#351 - Filipe Dias-L. / @sockyrc

12/06/2014 at 11:08AM

15
#352 - Thomas Larrieu / @t_larrieu

01/29/2015 at 05:41PM

15
#353 - Rathrio / @Rathrio

02/01/2015 at 02:28AM

15
#354 - César Enrique / @caenrique93

02/03/2015 at 11:49PM

15
#355 - Martin Liberg / @marreman

02/08/2015 at 05:15PM

15
#356 - Jonathan Martindell / @jonmartindell

02/27/2015 at 09:17PM

15
#357 - Mariano Macchi / @mmacchif

03/02/2015 at 04:25PM

15
#358 - Elizabeth / @sprinkles418

03/03/2015 at 05:58PM

15
#359 - David English / @Nglish26

03/27/2015 at 09:07PM

15
#360 - Cosmin Banu / @cosminb82

05/07/2015 at 09:40PM