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

683 active golfers, 2045 entries

Leaderboard (lowest score wins):
17
#571 - Brandon Height / @Lask0x

08/08/2017 at 03:56AM

17
#572 - Prithviraj Patil / @dummyprithviraj

12/03/2017 at 04:21PM

17
#573 - Di Peng / @DCodier

11/01/2018 at 10:30PM

17
#574 - Ng Sek Long / @NgSekLong

02/09/2019 at 05:00PM

17
#575 - MGJoe93 / @mgjoe93

03/03/2019 at 06:09PM

17
#576 - Mike C / @StrixVariaXIX

04/22/2019 at 04:14PM

18
#577 - Benjamin Williams / @benjaminjosephw

05/09/2014 at 04:24PM

18
#578 - Ɓukasz Makuch / @zopsesen

05/18/2014 at 03:47PM

18
#579 - debris / @iDebris5

05/18/2014 at 03:51PM

18
#580 - tobeportable / @tobeportable

05/22/2014 at 02:52PM

18
#581 - Ilya Strukov / @i1ey

05/23/2014 at 11:42AM

18
#582 - TimWolla / @TimWolla

06/02/2014 at 11:06PM

18
#583 - Nelson Senna / @nelson_senna

06/03/2014 at 03:21PM

18
#584 - Mayor Guelph / @RogerGuelph

06/11/2014 at 02:03AM

18
#585 - Martijn Theunissen / @Damnesia__

06/12/2014 at 11:37PM

18
#586 - uncleringo / @uncleringo

07/02/2014 at 08:34AM

18
#587 - madka / @lachrimae_pavan

08/03/2014 at 04:36PM

18
#588 - Adrian Bradd / @keepab

09/01/2014 at 12:16AM

18
#589 - Dario Avitabile / @tutticapaci

09/01/2014 at 01:30PM

18
#590 - Deepak Surti / @dmsurti

03/16/2015 at 02:38PM

18
#591 - Akash Bhardwaj / @akashbdj

03/25/2015 at 01:56PM

18
#592 - Ryan Marcotte / @ryanjmarcotte

11/13/2015 at 01:57AM

18
#593 - TaoChen / @632143592Tao

06/21/2016 at 09:56AM

18
#594 - sijinyuan / @sijinyuan

02/22/2017 at 02:17AM

18
#595 - C / @bravekarma

10/15/2017 at 07:37AM

18
#596 - Ron Alexssen / @Ralexhere

11/01/2017 at 07:52PM

18
#597 - phucvin / @phucvin

02/14/2018 at 04:54PM

18
#598 - z0c / @zerocabal

06/11/2018 at 01:32PM

18
#599 - Phil Devitt / @GeneralHav0k

01/02/2019 at 10:35PM

18
#600 - Cameron Fowler / @camfowler

03/19/2019 at 03:01AM