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

661 active golfers, 1975 entries

Leaderboard (lowest score wins):
16
#451 - Chad / @__chad__

04/15/2015 at 07:45PM

16
#452 - Salar Khan / @salarkhan_

04/29/2015 at 12:42AM

16
#453 - Marc Coquand / @MarcCoquand

05/28/2015 at 11:12PM

16
#454 - Eduardo Antunes / @ecsousa

06/11/2015 at 09:31PM

16
#455 - Adrian Krehl / @akrehl

06/29/2015 at 05:32PM

16
#456 - Teemu Okkonen / @TeemuOkkonen

07/09/2015 at 06:41PM

16
#457 - Brian Besmanoff / @BrianBesmanoff

08/06/2015 at 05:14AM

16
#458 - Alain / @ducouloa

11/30/2015 at 08:52AM

16
#459 - Holden Lewis / @lonnez90

12/09/2015 at 10:51PM

16
#460 - Izabel Jelenić / @IzabelJelenic

12/25/2015 at 11:00PM

16
#461 - Bingyunx / @bingyunx

12/28/2015 at 11:21AM

16
#462 - Markus Bohl / @bohl_markus

02/26/2016 at 02:12PM

16
#463 - Pablo R. Dinella / @pablordinella

06/11/2016 at 02:43PM

16
#464 - Pablo Cobelli / @pablocobelli

06/21/2016 at 03:46AM

16
#465 - BlackCap / @BlackCapCoder

11/23/2016 at 06:09PM

16
#466 - Alexander Gryson / @agryson

05/04/2017 at 08:34PM

16
#467 - Gurukandhamoorthi / @Gurukandhamoor1

07/10/2017 at 01:39PM

16
#468 - Saul Hardman / @saulhardman

08/10/2017 at 08:53AM

16
#469 - Jonathan Ambrose / @jambrose78

06/13/2018 at 08:37PM

16
#470 - 村橋究理基M.Kuriki@北大 / @mkuriki_

08/11/2018 at 12:00PM

16
#471 - Hugo / @szeyattai

08/17/2018 at 08:08AM

16
#472 - Rebecca V. / @rxbxccxv

02/05/2019 at 12:00AM

16
#473 - Groovy / @groovy9

03/08/2019 at 04:46PM

16
#474 - ささ / @nick11033

05/18/2019 at 08:07AM

17
#475 - Brett Cassette / @brettcassette

05/15/2014 at 01:17AM

17
#476 - James / @Dronak

05/15/2014 at 01:43PM

17
#477 - Dmitry Teslenko / @krab_mozga

05/16/2014 at 09:06AM

17
#478 - Phil Pirozhkov / @philpirj

05/17/2014 at 01:15PM

17
#479 - Kyle Travis / @kmakai

05/17/2014 at 08:46PM

17
#480 - Michi Loro / @michiloro

05/19/2014 at 08:42AM