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

755 active golfers, 2364 entries

Leaderboard (lowest score wins):
16
#541 - Rebecca V. / @rxbxccxv

02/05/2019 at 12:00AM

16
#542 - Groovy / @groovy9

03/08/2019 at 04:46PM

16
#543 - ささ / @nick11033

05/18/2019 at 08:07AM

16
#544 - majo senf / @majo_senf

06/17/2019 at 01:08PM

16
#545 - Ariel Miculas / @ArielMiculas

09/26/2019 at 11:38AM

16
#546 - oldandslow / @oldandslow5

11/27/2019 at 01:04PM

16
#547 - bladehaze / @bladehaze

05/02/2020 at 10:54PM

16
#548 - RockerZZY / @rocker_zzy

06/08/2020 at 12:39AM

16
#549 - vimgolfaccfekxh / @vimgolfaccfekxh

10/30/2022 at 10:39PM

16
#550 - _3tHeR_ / @3ther-joyboy

11/21/2024 at 02:07PM

16
#551 - Nathan Priego / @nspriego

02/22/2025 at 02:24AM

17
#552 - Brett Cassette / @brettcassette

05/15/2014 at 01:17AM

17
#553 - James / @Dronak

05/15/2014 at 01:43PM

17
#554 - Dmitry Teslenko / @krab_mozga

05/16/2014 at 09:06AM

17
#555 - Phil Pirozhkov / @philpirj

05/17/2014 at 01:15PM

17
#556 - Kyle Travis / @kmakai

05/17/2014 at 08:46PM

17
#557 - Michi Loro / @michiloro

05/19/2014 at 08:42AM

17
#558 - Drew DeVault / @sircmpwn

05/19/2014 at 06:35PM

17
#559 - codegourmet / @codegourmet

05/21/2014 at 11:47AM

17
#560 - Tojo Chacko / @tojochacko

05/26/2014 at 04:27AM

17
#561 - yusukesasaki / @yysaki

06/01/2014 at 01:36PM

17
#562 - Karun Ramakrishnan / @the_karun

06/02/2014 at 03:22AM

17
#563 - Sarah Ransohoff / @sranso

06/03/2014 at 02:00AM

17
#564 - Brian Peck / @bpeck614

06/03/2014 at 03:41PM

17
#565 - James Ryland Miller / @longhornxtreme

06/04/2014 at 08:57PM

17
#566 - Brad DeShong / @braddeshong

06/11/2014 at 01:12AM

17
#567 - Herr Oppermann / @HerrOppermann

06/15/2014 at 02:45PM

17
#568 - Leland Paul Kusmer / @lelandpaul

06/15/2014 at 11:43PM

17
#569 - compiled wrong / @compiledwrong

06/16/2014 at 07:16AM

17
#570 - Darrin McCarthy / @darrinmc

06/21/2014 at 09:03PM