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

646 active golfers, 1921 entries

Leaderboard (lowest score wins):
19
#571 - Chris Davison / @davisonnn

05/24/2014 at 11:16PM

19
#572 - Masha Rikhter / @mrikhter

07/09/2014 at 10:50PM

19
#573 - JonathanStarnes / @JON_STARNES

08/08/2014 at 02:35AM

19
#574 - Siddhartha R Thota / @tweetingsid

08/11/2014 at 10:41AM

19
#575 - Roy Vim / @RoyVim

09/24/2014 at 10:22PM

19
#576 - AC / @quadface

10/03/2014 at 07:46PM

19
#577 - Nicolas Dascanio / @NicoDascanio

12/05/2014 at 05:36PM

19
#578 - Yuan Guan / @yuanguan89

03/03/2015 at 10:03AM

19
#579 - chvzvhn / @chvzvhn

04/26/2015 at 05:07AM

19
#580 - Personal Life Trackr / @PersLifeTrackr

05/26/2015 at 10:03PM

19
#581 - Hervé Rouault / @hrouault

06/09/2015 at 07:48PM

19
#582 - Shizukesa / @Shizukesa

07/06/2015 at 10:54PM

19
#583 - Samir Sadek / @netsamir

07/20/2015 at 08:50PM

19
#584 - darookee / @darookee

07/24/2015 at 09:48AM

19
#585 - Ben Vandervalk / @benvvalk

09/14/2015 at 05:19AM

19
#586 - Dan Madden / @guthran

07/18/2016 at 02:33PM

19
#587 - Andreas Anderbach / @anderbacha

03/21/2017 at 04:58PM

19
#588 - caplod / @caplod

03/25/2017 at 03:08PM

19
#589 - Geoff / @RealGeoffErwin

10/09/2017 at 06:58PM

19
#590 - Austin Ware / @AustinWare17

03/12/2018 at 08:51PM

19
#591 - niwatoco / @yoshitune9

07/19/2018 at 07:50PM

19
#592 - Random / @Random29985999

11/29/2018 at 03:50PM

19
#593 - Graham Singer / @grahamsinger

01/05/2019 at 05:25AM

20
#594 - Joseph Tyler Jones / @josephtyler

05/12/2014 at 10:13PM

20
#595 - Jan Wedekind / @wedesoft

06/03/2014 at 09:46PM

20
#596 - Pablo Acuña R. / @pabloacunar

06/22/2014 at 11:46PM

20
#597 - Akshay Aurora / @akshayaurora

09/16/2014 at 07:40AM

20
#598 - Edmundo Perez / @ingedmundo

12/03/2014 at 07:13PM

20
#599 - Maxime / @Maxime_VII

06/23/2015 at 02:45PM

20
#600 - かりうむ / @ka1l

12/07/2015 at 04:09AM