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

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 322 remaining solutions by signing in and submitting your own entry
#323 Jongsang Tack (Ben) / @BenJongsang - Score: 261 - 09/11/22 @ 15:17
vf>xiauto<Esc>lllllllllxjhhhhhhhhhhh<C-Q>lllllllllllllllllhjjjxklllllllllllllla = <Del><Esc>lllhh:%s/;/,/g<CR>kkkji<BS><Esc>jhhhhhhhhhhi<BS><Esc>jhhhhhhi<BS><Esc>lllllllxhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh/<Esc>:%s/(//g<CR>:%s/)//g<CR>wwwi{ <Esc>$a{<BS>};<Esc>hhhhhhhhhhhhhhhhhhhhhi l<BS><Esc>lllllllli <Esc>lllllllllli <Esc>llllli <Esc>:w<CR>:wq<CR>

0 comments


Created by: @nd1832

323 active golfers, 1400 entries

Leaderboard (lowest score wins):
44
#181 - Cata / @catacox17

04/05/2023 at 08:28PM

44
#182 - Olivier Bégassat / @zk_evm

06/11/2023 at 02:39PM

44
#183 - Daniel Apt / @DanielApt

08/26/2023 at 04:35PM

44
#184 - Giacomo Sansone / @pcineverdies

07/05/2024 at 07:55PM

44
#185 - Pablo Acuna / @pacuna

11/13/2024 at 02:33AM

45
#186 - Łukasz / @srokadev

03/18/2021 at 11:11AM

45
#187 - Captain Proton / @CaptainProton5

06/21/2021 at 11:53AM

45
#188 - iBhagwan / @iiBhagwan

07/07/2021 at 04:21AM

45
#189 - Thitichote Chaimuang / @ThitichoteC

03/03/2022 at 09:05AM

45
#190 - seenz / @lefton_sean

05/14/2022 at 09:10PM

45
#191 - Rao Zvorovski / @RaoZvorovski

01/18/2023 at 01:34AM

45
#192 - @AndrewRadev@hachyderm.io / @andrewradev

03/19/2023 at 11:07AM

45
#193 - Maarten Craeynest / @Maarten_Cr

06/28/2023 at 07:42PM

45
#194 - MojoLake / @vim_golf1

07/27/2023 at 12:05PM

46
#195 - pherapont / @pherapont1

12/20/2020 at 07:35AM

46
#196 - AAbraxas / @AAbraxas1

02/05/2021 at 08:50PM

46
#197 - SwordSwordSwordBird / @SwordSwordBird

02/21/2021 at 07:50AM

46
#198 - Neil Butler / @PinkyinParis

08/23/2021 at 02:38AM

46
#199 - good enough ; 🌿 / @daisyymint

03/03/2022 at 02:08PM

46
#200 - Zhou Jiazheng / @ZhouJiazheng0

02/19/2023 at 02:03PM

46
#201 - constap / @constap

04/26/2024 at 12:00AM

47
#202 - nd183 / @nd1832

12/10/2020 at 09:32AM

47
#203 - 木木 / @rongmazhong

12/11/2020 at 03:31AM

47
#204 - Horst / @Horst91706815

01/20/2021 at 01:34PM

47
#205 - zapakh / @zapakh

01/21/2021 at 05:05AM

47
#206 - Ska / @skaa42

07/17/2021 at 09:23AM

47
#207 - Alaris Morissette / @Alaris_Villain

07/30/2021 at 03:37AM

47
#208 - BryanYan / @BryanGoesPlaces

10/17/2021 at 02:45PM

47
#209 - vimgolfaccfekxh / @vimgolfaccfekxh

10/30/2022 at 01:50PM

47
#210 - Thomas Hiron / @thomashiron

02/20/2023 at 12:03PM