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
#181 - Zhihong Liu / @pieapple03

02/22/2017 at 02:01AM

13
#182 - Alexander Bessonov / @nonsleepr

03/15/2017 at 08:52PM

13
#183 - Ilya Shakirov / @aelaau

03/20/2017 at 03:19PM

13
#184 - 梧桐王子 / @WutongYujie

04/26/2017 at 05:27AM

13
#185 - Chris Robertson / @chrisxrobertson

05/18/2017 at 01:41PM

13
#186 - Melvin Cheung / @MelvinCheung

05/25/2017 at 05:52PM

13
#187 - Ernesto Barros / @ernestobarros7

05/27/2017 at 06:47PM

13
#188 - David Gustavsson / @mrGustaphe

06/14/2017 at 02:51PM

13
#189 - Bennett Bernardoni / @BBernardoni

06/28/2017 at 10:08PM

13
#190 - 杨洋 / @176795444

08/29/2017 at 11:27AM

13
#191 - Turkey Man / @lvturkeyman

11/08/2017 at 06:33PM

13
#192 - Benoit Mortgat / @Benoit_Mortgat

11/14/2017 at 12:35PM

13
#193 - BarbaJol / @drpproteus

01/05/2018 at 03:28PM

13
#194 - ParasamGateZero / @ParasamGateZero

02/01/2018 at 04:56AM

13
#195 - Arijus / @argshook

02/09/2018 at 09:51AM

13
#196 - Pavol Slamka / @Archipedes

03/12/2018 at 10:52PM

13
#197 - GreenPinguin / @GreenPinguin2

03/14/2018 at 01:03PM

13
#198 - Guirec CORBEL / @GuirecCorbel

04/05/2018 at 04:04AM

13
#199 - vimthrowaway / @vimgolf_throw

04/08/2018 at 01:57PM

13
#200 - DHM / @DHM29978992

04/15/2018 at 02:14AM

13
#201 - towc / @MateiCopot

05/25/2018 at 04:18PM

13
#202 - Daniël De Koker / @daniel_koker

06/19/2018 at 08:40PM

13
#203 - Apox / @apox159

07/19/2018 at 12:14AM

13
#204 - fucus / @fishlovebanana

08/09/2018 at 08:41AM

13
#205 - 🌀🦋Miriam Retka🦋🌀 / @miriamretka

08/30/2018 at 10:56PM

13
#206 - Jeff / @sir_wiggles3

09/09/2018 at 08:26PM

13
#207 - Bart3k / @Bart3k3

09/12/2018 at 06:50AM

13
#208 - Robin De Mol / @RobinDeMol

09/14/2018 at 09:26AM

13
#209 - Brendan B Amdocs / @AmdocsB

09/25/2018 at 02:15PM

13
#210 - Rasmus Bergström / @JRasmusBm

09/29/2018 at 10:04PM