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):
13
#121 - Kenny / @zumalifeguard

05/15/2015 at 04:00PM

13
#122 - Sahana Rajasekar / @sahanarajasekar

06/11/2015 at 03:31AM

13
#123 - Clark DuVall / @theclarkatron

06/11/2015 at 07:09PM

13
#124 - Thomas McGinniss / @thom_bomb75

06/12/2015 at 11:49PM

13
#125 - raghu erapaneedi / @raghue9

06/23/2015 at 09:53AM

13
#126 - Mutter Mumble / @muttermumble

06/23/2015 at 04:20PM

13
#127 - Andres Manz / @manz_andres

06/24/2015 at 01:12PM

13
#128 - vimgolf / @myspare307

07/15/2015 at 10:31PM

13
#129 - David Willming / @wdialvmeo

07/17/2015 at 03:13AM

13
#130 - Ferdev vimgolf / @fergvimgolf

08/10/2015 at 04:19AM

13
#131 - Дима Давыдов / @xaykot

08/15/2015 at 08:21AM

13
#132 - Sergey Semushin / @Predelnik

09/01/2015 at 05:42AM

13
#133 - Veritas / @_VeritasL

09/01/2015 at 01:52PM

13
#134 - Paulo Romeira / @pauloromeira

09/04/2015 at 07:34AM

13
#135 - Mike Adams / @davis_cromwell

09/30/2015 at 08:34PM

13
#136 - DespicableJerk / @JerkDespicable

10/21/2015 at 03:07PM

13
#137 - NuM / @NuM314

10/24/2015 at 08:06AM

13
#138 - Benjamin Espey / @bennyty

11/07/2015 at 05:34AM

13
#139 - Julian Andrews / @NoLemurs

11/08/2015 at 10:33PM

13
#140 - Robert Goeddel / @f0rdpr3fect

11/10/2015 at 05:03PM

13
#141 - Árpád Krejczinger / @krarpi

11/11/2015 at 12:05PM

13
#142 - Tom Sisk / @TomSisk

11/14/2015 at 02:33AM

13
#143 - Get Sharp / @get_Sh4rp

11/15/2015 at 06:30AM

13
#144 - Daniil Nguen / @DNguen

11/24/2015 at 08:48PM

13
#145 - Wilmer Bandres / @WilmerBandres

12/05/2015 at 11:05PM

13
#146 - Charlie / @wookie_giant

12/22/2015 at 09:41PM

13
#147 - Jon Krause / @jkrause314

01/13/2016 at 03:14AM

13
#148 - retro / @tryphopp

01/17/2016 at 10:18AM

13
#149 - Roberto Carraretto / @robcarraretto

01/17/2016 at 01:36PM

13
#150 - Aleksey Zhidkov / @AlexeyZhidkov

01/28/2016 at 05:19AM