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 302 remaining solutions by signing in and submitting your own entry
#303 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

303 active golfers, 1315 entries

Leaderboard (lowest score wins):
43
#151 - Injae Kang / @abcinje

07/14/2023 at 05:14PM

43
#152 - jonas-grobe / @jonas-grobe

02/01/2024 at 10:02PM

44
#153 - jirgn / @jirgn

12/10/2020 at 09:08PM

44
#154 - Gunter Kluge / @KlugeGunter

01/08/2021 at 09:05PM

44
#155 - Arryue / @Arryue2

01/17/2021 at 02:43AM

44
#156 - Yondonjamts Ganzorig / @yondonjamts_g

01/21/2021 at 07:43PM

44
#157 - OtterPy / @OtterPy

01/26/2021 at 05:39PM

44
#158 - Blake Tereau / @BlakeTereau

02/10/2021 at 06:06PM

44
#159 - Shivam Sharma / @getshivam

03/03/2021 at 12:44PM

44
#160 - omer vishlitzky / @OVishlitzky

03/20/2021 at 11:07AM

44
#161 - grosa / @_grosa_

06/09/2021 at 04:14AM

44
#162 - Der Natsch / @dernatsch

12/07/2021 at 06:24PM

44
#163 - ดิว - รุจิภาส / @deadbook60

03/03/2022 at 08:29AM

44
#164 - แฟน___คนโปรด / @WannaPlayGame_

03/03/2022 at 09:24AM

44
#165 - tarotbybye / @tarotbybyeart

03/03/2022 at 11:28AM

44
#166 - Javier Contreras / @contranton

05/04/2022 at 07:09PM

44
#167 - steve / @steve35773420

05/27/2022 at 02:24AM

44
#168 - DW Luna / @dcheed_

12/21/2022 at 09:20PM

44
#169 - Cata / @catacox17

04/05/2023 at 08:28PM

44
#170 - Olivier Bégassat / @zk_evm

06/11/2023 at 02:39PM

44
#171 - Daniel Apt / @DanielApt

08/26/2023 at 04:35PM

45
#172 - Łukasz / @srokadev

03/18/2021 at 11:11AM

45
#173 - Captain Proton / @CaptainProton5

06/21/2021 at 11:53AM

45
#174 - iBhagwan / @iiBhagwan

07/07/2021 at 04:21AM

45
#175 - Thitichote Chaimuang / @ThitichoteC

03/03/2022 at 09:05AM

45
#176 - seenz / @lefton_sean

05/14/2022 at 09:10PM

45
#177 - Rao Zvorovski / @RaoZvorovski

01/18/2023 at 01:34AM

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

03/19/2023 at 11:07AM

45
#179 - Maarten Craeynest / @Maarten_Cr

06/28/2023 at 07:42PM

45
#180 - MojoLake / @vim_golf1

07/27/2023 at 12:05PM