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):
13
#151 - Austin Wood / @indiesquidge

02/03/2016 at 05:56PM

13
#152 - Janine Cheng / @janineist

02/12/2016 at 03:25PM

13
#153 - Michael Buckley / @apolatg

02/13/2016 at 08:06PM

13
#154 - ben kavanagh / @bkava

02/23/2016 at 02:27AM

13
#155 - Jaron Hamlik / @jdhamlik

02/27/2016 at 04:10AM

13
#156 - Dimitar Dimitrov / @kurkale6ka

03/11/2016 at 02:04PM

13
#157 - Dinesh Bhosale / @MrDineshBhosale

04/01/2016 at 10:30AM

13
#158 - Saki Gw / @Sakigw

04/03/2016 at 06:21PM

13
#159 - Matteo Signer / @MatteoSigner

04/26/2016 at 08:59AM

13
#160 - John Goes / @johnwgoes

05/08/2016 at 03:54AM

13
#161 - Andres Araya / @arayaandresfco

05/20/2016 at 03:32PM

13
#162 - Yudi Matsuzake / @yudimatsuzake

06/09/2016 at 03:38PM

13
#163 - John Doe Sr. / @johndoe67890543

06/11/2016 at 01:58PM

13
#164 - 王运 / @640138017

07/21/2016 at 12:50AM

13
#165 - William Snyders / @iam2391212

07/24/2016 at 06:23PM

13
#166 - Jeremiah Goyette / @JeremiahGoyette

08/01/2016 at 05:21AM

13
#167 - Will / @obiwan__k3n00bi

08/30/2016 at 03:58AM

13
#168 - jdupont655 / @jdupont655

09/02/2016 at 11:14AM

13
#169 - Stephen Aument / @saument

09/03/2016 at 05:01AM

13
#170 - loki2441 / @loki2441

09/10/2016 at 09:49PM

13
#171 - Constantine / @ConstantineHatz

09/26/2016 at 07:13PM

13
#172 - Nico / @_Nico_Caro

10/01/2016 at 04:29PM

13
#173 - poke / @useraaaaaaaaaaf

10/05/2016 at 02:36PM

13
#174 - trx / @trxdbg

10/12/2016 at 03:44PM

13
#175 - swarkEafs / @EafsSwark

10/24/2016 at 11:17AM

13
#176 - Bill Ruddock / @biinari

10/31/2016 at 04:17AM

13
#177 - timerella® / @timerella

11/17/2016 at 10:33PM

13
#178 - Etienne Florent / @EtienneFlorent

11/23/2016 at 11:00PM

13
#179 - Pierre Maoui / @poupougnac

12/21/2016 at 01:22PM

13
#180 - Yann / @yannstad

02/21/2017 at 07:32AM