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

324 active golfers, 1402 entries

Leaderboard (lowest score wins):
34
#31 - a b c / @abc41115243

03/12/2021 at 04:34PM

34
#32 - pikjes / @pikjes2

03/20/2021 at 08:54PM

34
#33 - Arya Kumar / @SusSquirrel

05/16/2021 at 04:38PM

34
#34 - Peter Salvi / @salvipeter

05/19/2021 at 02:12PM

34
#35 - Michael / @Michael62785035

05/24/2021 at 08:12PM

34
#36 - vim_maxter / @MaxterVim

07/05/2021 at 07:17AM

34
#37 - 悟史 / @A1OBJTxN5fTg5EJ

07/13/2021 at 05:05PM

34
#38 - BarePotato / @BarePotato

07/13/2021 at 11:33PM

34
#39 - Alex / @Ergho

07/13/2021 at 11:33PM

34
#40 - Hourann Lin / @HourannLin

08/05/2021 at 03:47PM

34
#41 - Roman Privalov / @RomanPrivalov

08/23/2021 at 05:13PM

34
#42 - vimgolf_vinz / @VimgolfV

09/27/2021 at 08:33PM

34
#43 - Benny Boy / @bennyboy999

10/02/2021 at 07:29PM

34
#44 - Denis / @dkol2000

10/21/2021 at 07:53AM

34
#45 - Jean George / @JeanGeo20504212

11/22/2021 at 07:35PM

34
#46 - ややお / @yayaoh

12/19/2021 at 02:20PM

34
#47 - Max / @Max17868626

02/06/2022 at 01:07PM

34
#48 - yancy / @yancy_dong

04/28/2022 at 02:27PM

34
#49 - russellzhaomao / @russellzhaomao

05/22/2022 at 12:59PM

34
#50 - Irakli Chigvaria / @tchigvaria

07/02/2022 at 03:09PM

34
#51 - Pauli Taipale / @PauliTaipale

07/08/2022 at 11:17PM

34
#52 - gotovimpro / @gotovimpro1

09/13/2022 at 02:33PM

34
#53 - Saurabh / @saurabhDuzumaki

09/26/2022 at 07:01AM

34
#54 - Rohit Yadav / @yrohit250

09/26/2022 at 09:26PM

34
#55 - Topvimgolf Score / @topvimgolfscore

10/12/2022 at 10:29AM

34
#56 - limboste / @limboste

10/28/2022 at 04:46AM

34
#57 - bastien batardier / @supercamarche

11/08/2022 at 10:16PM

34
#58 - Austin Willliams / @GuitarMusash616

11/12/2022 at 08:32PM

34
#59 - idontwantaaccount / @fkURaccounts

11/30/2022 at 06:21PM

34
#60 - ky05uk3 / @kyo89347563

12/02/2022 at 01:49AM