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

668 active golfers, 2000 entries

Leaderboard (lowest score wins):
18
#571 - Nelson Senna / @nelson_senna

06/03/2014 at 03:21PM

18
#572 - Mayor Guelph / @RogerGuelph

06/11/2014 at 02:03AM

18
#573 - Martijn Theunissen / @Damnesia__

06/12/2014 at 11:37PM

18
#574 - uncleringo / @uncleringo

07/02/2014 at 08:34AM

18
#575 - madka / @lachrimae_pavan

08/03/2014 at 04:36PM

18
#576 - Adrian Bradd / @keepab

09/01/2014 at 12:16AM

18
#577 - Dario Avitabile / @tutticapaci

09/01/2014 at 01:30PM

18
#578 - Deepak Surti / @dmsurti

03/16/2015 at 02:38PM

18
#579 - Akash Bhardwaj / @akashbdj

03/25/2015 at 01:56PM

18
#580 - Ryan Marcotte / @ryanjmarcotte

11/13/2015 at 01:57AM

18
#581 - TaoChen / @632143592Tao

06/21/2016 at 09:56AM

18
#582 - sijinyuan / @sijinyuan

02/22/2017 at 02:17AM

18
#583 - C / @bravekarma

10/15/2017 at 07:37AM

18
#584 - Ron Alexssen / @Ralexhere

11/01/2017 at 07:52PM

18
#585 - phucvin / @phucvin

02/14/2018 at 04:54PM

18
#586 - z0c / @zerocabal

06/11/2018 at 01:32PM

18
#587 - Phil Devitt / @GeneralHav0k

01/02/2019 at 10:35PM

18
#588 - Cameron Fowler / @camfowler

03/19/2019 at 03:01AM

19
#589 - Chris Davison / @davisonnn

05/24/2014 at 11:16PM

19
#590 - Masha Rikhter / @mrikhter

07/09/2014 at 10:50PM

19
#591 - JonathanStarnes / @JON_STARNES

08/08/2014 at 02:35AM

19
#592 - Siddhartha R Thota / @tweetingsid

08/11/2014 at 10:41AM

19
#593 - Roy Vim / @RoyVim

09/24/2014 at 10:22PM

19
#594 - AC / @quadface

10/03/2014 at 07:46PM

19
#595 - Nicolas Dascanio / @NicoDascanio

12/05/2014 at 05:36PM

19
#596 - Yuan Guan / @yuanguan89

03/03/2015 at 10:03AM

19
#597 - chvzvhn / @chvzvhn

04/26/2015 at 05:07AM

19
#598 - Personal Life Trackr / @PersLifeTrackr

05/26/2015 at 10:03PM

19
#599 - Hervé Rouault / @hrouault

06/09/2015 at 07:48PM

19
#600 - Shizukesa / @Shizukesa

07/06/2015 at 10:54PM