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 5ba4962fbbac05000bc2ddec

Preferably without multi-cursor plugin

Originally asked as question on reddit by kpthunder: https://www.reddit.com/r/vim/comments/9fvsro/what_is_the_most_efficient_way_to_go_about/

Start file
newState.set('foo', foo);
newState.set('bar', bar);
newState.set('banana', banana);
newState.set('bears', bears);
End file
state.foo = payload.foo;
state.bar = payload.bar;
state.banana = payload.banana;
state.bears = payload.bears;

View Diff

1,4c1,4
< newState.set('foo', foo);
< newState.set('bar', bar);
< newState.set('banana', banana);
< newState.set('bears', bears);
---
> state.foo = payload.foo;
> state.bar = payload.bar;
> state.banana = payload.banana;
> state.bears = payload.bears;

Solutions by @rike09:

Unlock 16 remaining solutions by signing in and submitting your own entry
Created by: @argshook

129 active golfers, 540 entries

Solutions by @rike09:
30
#23 - Henrique Malheiro / @rike09

03/04/2023 at 10:38AM

30
#>23 - Henrique Malheiro / @rike09

03/04/2023 at 10:40AM

31
#>38 - Henrique Malheiro / @rike09

03/04/2023 at 10:36AM

32
#>47 - Henrique Malheiro / @rike09

03/04/2023 at 10:35AM

33
#>55 - Henrique Malheiro / @rike09

03/04/2023 at 10:34AM

34
#>58 - Henrique Malheiro / @rike09

03/04/2023 at 10:33AM

35
#>67 - Henrique Malheiro / @rike09

03/04/2023 at 10:28AM

36
#>80 - Henrique Malheiro / @rike09

03/04/2023 at 10:22AM

37
#>89 - Henrique Malheiro / @rike09

03/04/2023 at 10:20AM

39
#>103 - Henrique Malheiro / @rike09

03/04/2023 at 10:13AM

39
#>103 - Henrique Malheiro / @rike09

03/04/2023 at 10:17AM

40
#>105 - Henrique Malheiro / @rike09

03/04/2023 at 10:11AM

42
#>114 - Henrique Malheiro / @rike09

03/04/2023 at 10:06AM

43
#>117 - Henrique Malheiro / @rike09

03/04/2023 at 10:02AM

44
#>119 - Henrique Malheiro / @rike09

03/04/2023 at 10:05AM

46
#>122 - Henrique Malheiro / @rike09

03/04/2023 at 10:00AM