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):
17
#481 - compiled wrong / @compiledwrong

06/16/2014 at 07:16AM

17
#482 - Darrin McCarthy / @darrinmc

06/21/2014 at 09:03PM

17
#483 - Miguel R. Rubinos / @mrrubinos

06/22/2014 at 07:19PM

17
#484 - Tim Habermaas / @timhabermaas

06/24/2014 at 08:28PM

17
#485 - Mandy Choi / @mundi_c

06/28/2014 at 09:05AM

17
#486 - Kirill / @wedens_

07/09/2014 at 06:06AM

17
#487 - glennphillips / @glennphillips

07/09/2014 at 09:22PM

17
#488 - Paul Rodgers / @oursjaune

07/13/2014 at 02:31PM

17
#489 - HellBentSouthernGent / @ChiefThis

07/24/2014 at 06:07AM

17
#490 - Paul Axe / @Paul_Axe

07/29/2014 at 11:40AM

17
#491 - Duncan Parkinson / @duncanparkinson

07/31/2014 at 10:44AM

17
#492 - Patrick Pitoscia / @Patrick03960431

08/03/2014 at 07:14PM

17
#493 - Eric Potter / @pottereric

08/03/2014 at 08:16PM

17
#494 - Bednarik Boldizsar / @bboldi

08/04/2014 at 09:07PM

17
#495 - Blake / @blkbsstt

08/08/2014 at 06:46AM

17
#496 - Tj / @yrddy

08/13/2014 at 05:32AM

17
#497 - Alexey Permyakov / @AlexeyPermyakov

08/24/2014 at 11:42AM

17
#498 - John Doe / @JohnDoeAtLarge

08/26/2014 at 10:21PM

17
#499 - Kristof Vannotten / @kristofv

09/08/2014 at 07:07PM

17
#500 - Christoph Neuroth / @c089

10/18/2014 at 10:00AM

17
#501 - Kongqun Yang / @KongqunY

10/28/2014 at 05:27AM

17
#502 - Steve Lazaridis / @SteveLazaridis

11/03/2014 at 04:31PM

17
#503 - Alex Hioreanu / @hioreanu

11/10/2014 at 04:30AM

17
#504 - John Smith / @temp_soraismus

11/19/2014 at 06:51AM

17
#505 - jared swarts / @JaredSwarts

12/13/2014 at 05:01AM

17
#506 - Wade / @vvandy

12/16/2014 at 06:06AM

17
#507 - Johnny Develop / @johnnydevelop

12/23/2014 at 02:44PM

17
#508 - Russell Ball / @rtball2

01/11/2015 at 03:34PM

17
#509 - Raynard, Jordan / @raynard_jordan

01/14/2015 at 07:09PM

17
#510 - Алексанр Цыганков / @capybarov

02/13/2015 at 03:32PM