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

647 active golfers, 1928 entries

Leaderboard (lowest score wins):
16
#421 - chaffinch / @chaffinch

08/25/2014 at 03:33PM

16
#422 - Dmitriy / @_dpy_

09/03/2014 at 08:00PM

16
#423 - Mattias Fransson / @azzidoos

09/08/2014 at 04:15PM

16
#424 - dfleischman / @dfleischman

09/13/2014 at 06:03AM

16
#425 - Florent F. / @floff01

09/13/2014 at 09:32PM

16
#426 - Antonio De Luna / @Tony_1917

09/24/2014 at 04:43PM

16
#427 - Viktor Lindström / @ViktorLindstr_m

10/04/2014 at 06:43PM

16
#428 - Mateusz Jedrzejewski / @mjedrz

10/22/2014 at 08:05PM

16
#429 - Andy Zhang / @andyzg3

10/23/2014 at 03:07AM

16
#430 - ЕвгенийВ / @imater

10/27/2014 at 06:03AM

16
#431 - kungfuchad / @kungfuchad

10/28/2014 at 07:23PM

16
#432 - Davit Samvelyan / @DavitSamvelyan

11/13/2014 at 02:08PM

16
#433 - Thomas Geßler / @th_gessler

11/17/2014 at 09:10PM

16
#434 - Jan Novak / @odpadnimail

11/19/2014 at 04:07AM

16
#435 - Keyboard Fire / @KeyboardFire

11/22/2014 at 02:12PM

16
#436 - Rao Zvorovski / @RaoZvorovski

12/06/2014 at 07:04PM

16
#437 - Pierre Houssin / @PierreHoussin

12/16/2014 at 08:52PM

16
#438 - SilentFl / @Silent_Fl

01/27/2015 at 07:56AM

16
#439 - Steven Loria / @sloria1

02/15/2015 at 12:09AM

16
#440 - Javier Carpio / @SaxKazein

02/27/2015 at 01:00PM

16
#441 - Kiet Nguyen / @kietnguyen86

03/04/2015 at 10:35AM

16
#442 - Chad / @__chad__

04/15/2015 at 07:45PM

16
#443 - Salar Khan / @salarkhan_

04/29/2015 at 12:42AM

16
#444 - Marc Coquand / @MarcCoquand

05/28/2015 at 11:12PM

16
#445 - Eduardo Antunes / @ecsousa

06/11/2015 at 09:31PM

16
#446 - Adrian Krehl / @akrehl

06/29/2015 at 05:32PM

16
#447 - Teemu Okkonen / @TeemuOkkonen

07/09/2015 at 06:41PM

16
#448 - Brian Besmanoff / @BrianBesmanoff

08/06/2015 at 05:14AM

16
#449 - Alain / @ducouloa

11/30/2015 at 08:52AM

16
#450 - Holden Lewis / @lonnez90

12/09/2015 at 10:51PM