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

676 active golfers, 2019 entries

Leaderboard (lowest score wins):
15
#391 - Vladimir Bauer / @vbauerster

03/05/2016 at 06:48PM

15
#392 - glepha / @glepha_vim

03/16/2016 at 04:12AM

15
#393 - Keri Volans / @KeriVolans

04/03/2016 at 10:41AM

15
#394 - Jason Pleau / @JasonPleau

05/06/2016 at 02:02AM

15
#395 - Kenny Lau / @kkkennnny

06/02/2016 at 08:53AM

15
#396 - malet / @Malet

06/24/2016 at 10:35PM

15
#397 - Quatrix / @Quatrix

08/10/2016 at 09:52PM

15
#398 - イーサン / @metakirby5

08/18/2016 at 10:57PM

15
#399 - hor1ace / @hor3ace

09/09/2016 at 06:55PM

15
#400 - Jonathan Elliott / @jon__elliott

11/02/2016 at 05:51PM

15
#401 - Michał Dytko / @DytkoM

12/21/2016 at 09:25AM

15
#402 - Daniel / @Daniel00288663

03/17/2017 at 01:17PM

15
#403 - Миша Сорокин / @rafmikovi4

04/10/2017 at 11:59AM

15
#404 - Remus Dalrymple / @bornintheflames

05/05/2017 at 01:20AM

15
#405 - Chicuella / @chicuellahere

05/12/2017 at 03:24PM

15
#406 - John Smith / @johns32768

06/17/2017 at 11:55AM

15
#407 - Kris Ezra / @kris_ezra

02/03/2019 at 08:48PM

15
#408 - Mateen Ulhaq / @sicariusnoctis

02/12/2019 at 05:21AM

15
#409 - Damián Ariel Marotte / @damianarielm

05/16/2019 at 06:59AM

16
#410 - mathac / @mathacgolf

05/10/2014 at 09:42PM

16
#411 - john / @KMKY_Aha

05/11/2014 at 01:59PM

16
#412 - Ricardo M. Vilchis / @ajkaanbal

05/12/2014 at 04:34AM

16
#413 - Pedro Santos / @pedrosans

05/13/2014 at 10:19PM

16
#414 - 土ヤ / @ttsuchiya

05/13/2014 at 11:49PM

16
#415 - Felipe Jaramillo F / @mrfelipe

05/14/2014 at 04:33AM

16
#416 - Mick Garvey / @blarko

05/14/2014 at 09:22PM

16
#417 - Heron Medeiros / @heronmedeiros

05/14/2014 at 10:57PM

16
#418 - captain_morgan / @captain_morgan

05/20/2014 at 02:08AM

16
#419 - Mike Ballou / @ballou88

05/28/2014 at 04:27PM

16
#420 - Jake Eaton / @Jake__Eaton

06/01/2014 at 05:06AM