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

Modernise code

Modernise and clean up some C++ code.

Start file
std::vector<int> numbers;
numbers.push_back(1337);
numbers.push_back(424242);
numbers.push_back(12345678);
numbers.push_back(3141);
End file
auto numbers = { 1337, 424242, 12345678, 3141 };

View Diff

1,5c1
< std::vector<int> numbers;
< numbers.push_back(1337);
< numbers.push_back(424242);
< numbers.push_back(12345678);
< numbers.push_back(3141);
---
> auto numbers = { 1337, 424242, 12345678, 3141 };

Solutions by @maxtong1987:

Unlock 11 remaining solutions by signing in and submitting your own entry
Created by: @nd1832

306 active golfers, 1331 entries

Solutions by @maxtong1987:
34
#30 - maxtong / @maxtong1987

03/12/2021 at 04:32AM

34
#>30 - maxtong / @maxtong1987

03/12/2021 at 04:42AM

34
#>30 - maxtong / @maxtong1987

03/12/2021 at 04:50AM

34
#>30 - maxtong / @maxtong1987

03/12/2021 at 04:52AM

38
#>111 - maxtong / @maxtong1987

03/12/2021 at 04:25AM

41
#>124 - maxtong / @maxtong1987

03/12/2021 at 04:22AM

42
#>136 - maxtong / @maxtong1987

03/12/2021 at 04:08AM

46
#>185 - maxtong / @maxtong1987

03/12/2021 at 03:54AM

47
#>192 - maxtong / @maxtong1987

03/12/2021 at 03:43AM

57
#>255 - maxtong / @maxtong1987

03/12/2021 at 03:38AM

68
#>282 - maxtong / @maxtong1987

03/12/2021 at 03:35AM