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 @DakshaChatur:

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

753 active golfers, 2357 entries

Solutions by @DakshaChatur:
13
#264 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:09AM

14
#>389 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:08AM

14
#>389 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:09AM

15
#>465 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:08AM

16
#>547 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:07AM

17
#>636 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:06AM

17
#>636 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:07AM

18
#>665 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:06AM

19
#>688 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:05AM

20
#>703 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:05AM

21
#>714 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:04AM

22
#>730 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:03AM

23
#>734 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:03AM

24
#>740 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:01AM

25
#>746 - Daksha Chatur / @DakshaChatur

09/26/2022 at 06:00AM

26
#>750 - Daksha Chatur / @DakshaChatur

09/26/2022 at 05:59AM

27
#>751 - Daksha Chatur / @DakshaChatur

09/26/2022 at 05:57AM

28
#>752 - Daksha Chatur / @DakshaChatur

09/26/2022 at 05:56AM

30
#>753 - Daksha Chatur / @DakshaChatur

09/26/2022 at 05:56AM