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 by @flimsy_giraffe:

Unlock 9 remaining solutions by signing in and submitting your own entry
Created by: @EdgarHipp

753 active golfers, 2357 entries

Solutions by @flimsy_giraffe:
13
#258 - Flimsy Giraffe / @flimsy_giraffe

11/28/2021 at 05:38PM

14
#>389 - Flimsy Giraffe / @flimsy_giraffe

11/28/2021 at 05:37PM

15
#>465 - Flimsy Giraffe / @flimsy_giraffe

11/28/2021 at 05:37PM

17
#>636 - Flimsy Giraffe / @flimsy_giraffe

11/28/2021 at 05:34PM

17
#>637 - Flimsy Giraffe / @flimsy_giraffe

10/05/2023 at 06:08PM

18
#>665 - Flimsy Giraffe / @flimsy_giraffe

11/28/2021 at 05:32PM

18
#>665 - Flimsy Giraffe / @flimsy_giraffe

10/05/2023 at 06:08PM

21
#>714 - Flimsy Giraffe / @flimsy_giraffe

11/28/2021 at 05:30PM

21
#>714 - Flimsy Giraffe / @flimsy_giraffe

10/05/2023 at 06:07PM