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

226 active golfers, 1001 entries

Leaderboard (lowest score wins):
44
#121 - jirgn / @jirgn

12/10/2020 at 09:08PM

44
#122 - Gunter Kluge / @KlugeGunter

01/08/2021 at 09:05PM

44
#123 - Arryue / @Arryue2

01/17/2021 at 02:43AM

44
#124 - Yondonjamts Ganzorig / @yondonjamts_g

01/21/2021 at 07:43PM

44
#125 - OtterPy / @OtterPy

01/26/2021 at 05:39PM

44
#126 - Blake Tereau / @BlakeTereau

02/10/2021 at 06:06PM

44
#127 - Shivam Sharma / @getshivam

03/03/2021 at 12:44PM

44
#128 - omer vishlitzky / @OVishlitzky

03/20/2021 at 11:07AM

44
#129 - grosa / @_grosa_

06/09/2021 at 04:14AM

44
#130 - Der Natsch / @dernatsch

12/07/2021 at 06:24PM

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

03/03/2022 at 08:29AM

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

03/03/2022 at 09:24AM

44
#133 - tarotbybye / @tarotbybyeart

03/03/2022 at 11:28AM

44
#134 - Javier Contreras / @contranton

05/04/2022 at 07:09PM

44
#135 - steve / @steve35773420

05/27/2022 at 02:24AM

45
#136 - Łukasz / @srokadev

03/18/2021 at 11:11AM

45
#137 - Captain Proton / @CaptainProton5

06/21/2021 at 11:53AM

45
#138 - iBhagwan / @iiBhagwan

07/07/2021 at 04:21AM

45
#139 - Thitichote Chaimuang / @ThitichoteC

03/03/2022 at 09:05AM

45
#140 - seenz / @lefton_sean

05/14/2022 at 09:10PM

46
#141 - pherapont / @pherapont1

12/20/2020 at 07:35AM

46
#142 - AAbraxas / @AAbraxas1

02/05/2021 at 08:50PM

46
#143 - SwordSwordSwordBird / @SwordSwordBird

02/21/2021 at 07:50AM

46
#144 - Neil Butler / @PinkyinParis

08/23/2021 at 02:38AM

46
#145 - good enough ; 🌿 / @daisyymint

03/03/2022 at 02:08PM

47
#146 - nd183 / @nd1832

12/10/2020 at 09:32AM

47
#147 - 木木 / @rongmazhong

12/11/2020 at 03:31AM

47
#148 - Horst / @Horst91706815

01/20/2021 at 01:34PM

47
#149 - zapakh / @zapakh

01/21/2021 at 05:05AM

47
#150 - Ska / @skaa42

07/17/2021 at 09:23AM