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):
18
#571 - Dario Avitabile / @tutticapaci

09/01/2014 at 01:30PM

18
#572 - Deepak Surti / @dmsurti

03/16/2015 at 02:38PM

18
#573 - Akash Bhardwaj / @akashbdj

03/25/2015 at 01:56PM

18
#574 - Ryan Marcotte / @ryanjmarcotte

11/13/2015 at 01:57AM

18
#575 - TaoChen / @632143592Tao

06/21/2016 at 09:56AM

18
#576 - sijinyuan / @sijinyuan

02/22/2017 at 02:17AM

18
#577 - C / @bravekarma

10/15/2017 at 07:37AM

18
#578 - Ron Alexssen / @Ralexhere

11/01/2017 at 07:52PM

18
#579 - phucvin / @phucvin

02/14/2018 at 04:54PM

18
#580 - z0c / @zerocabal

06/11/2018 at 01:32PM

18
#581 - Phil Devitt / @GeneralHav0k

01/02/2019 at 10:35PM

18
#582 - Cameron Fowler / @camfowler

03/19/2019 at 03:01AM

19
#583 - Chris Davison / @davisonnn

05/24/2014 at 11:16PM

19
#584 - Masha Rikhter / @mrikhter

07/09/2014 at 10:50PM

19
#585 - JonathanStarnes / @JON_STARNES

08/08/2014 at 02:35AM

19
#586 - Siddhartha R Thota / @tweetingsid

08/11/2014 at 10:41AM

19
#587 - Roy Vim / @RoyVim

09/24/2014 at 10:22PM

19
#588 - AC / @quadface

10/03/2014 at 07:46PM

19
#589 - Nicolas Dascanio / @NicoDascanio

12/05/2014 at 05:36PM

19
#590 - Yuan Guan / @yuanguan89

03/03/2015 at 10:03AM

19
#591 - chvzvhn / @chvzvhn

04/26/2015 at 05:07AM

19
#592 - Personal Life Trackr / @PersLifeTrackr

05/26/2015 at 10:03PM

19
#593 - Hervé Rouault / @hrouault

06/09/2015 at 07:48PM

19
#594 - Shizukesa / @Shizukesa

07/06/2015 at 10:54PM

19
#595 - Samir Sadek / @netsamir

07/20/2015 at 08:50PM

19
#596 - darookee / @darookee

07/24/2015 at 09:48AM

19
#597 - Ben Vandervalk / @benvvalk

09/14/2015 at 05:19AM

19
#598 - Dan Madden / @guthran

07/18/2016 at 02:33PM

19
#599 - Andreas Anderbach / @anderbacha

03/21/2017 at 04:58PM

19
#600 - caplod / @caplod

03/25/2017 at 03:08PM