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):
35
#91 - Bangash💉💉 / @DevotionGeo

10/10/2022 at 02:55PM

35
#92 - elhoc / @elhoc2

02/14/2023 at 03:50PM

35
#93 - sap / @sap38838304

04/26/2023 at 04:44AM

35
#94 - naka / @nak38223985244

07/30/2023 at 02:02AM

35
#95 - Victor Phan / @Victor_Phan

08/31/2023 at 12:34AM

35
#96 - 0xf00ff00f / @0xf00ff00f

10/19/2023 at 12:59PM

35
#97 - Luoyb / @Luoyb

10/25/2023 at 12:39AM

35
#98 - EtherFan / @ether_fan

02/25/2024 at 01:33PM

35
#99 - Elliot Schemmel / @regulated

10/07/2024 at 09:23PM

36
#100 - Filipe Brandenburger / @filbranden

12/10/2020 at 07:27PM

36
#101 - Vahan / @Vahan00900245

10/06/2021 at 01:03PM

36
#102 - POSIX / @po6ix

01/08/2022 at 05:00AM

36
#103 - quemeraisc / @quemeraisc

05/17/2022 at 02:05PM

36
#104 - Janzen / @__Coos

10/07/2022 at 08:44AM

36
#105 - gpfl0712 / @gpfl0712

04/13/2024 at 10:29PM

36
#106 - Pim / @Pireax

11/08/2024 at 03:10AM

37
#107 - Demian Martinez / @demianuco

12/10/2020 at 12:17PM

37
#108 - Dan / @dstein64

12/10/2020 at 05:24PM

37
#109 - Ray Dennis / @raysden

01/11/2021 at 02:52PM

37
#110 - Askhento / @Askhento1

01/27/2021 at 01:29AM

37
#111 - treb / @treb03683130

03/12/2021 at 01:13PM

37
#112 - mevmev / @mevmev8

08/18/2021 at 09:52AM

37
#113 - Felix Linhardt / @FelixLinhardt

03/20/2022 at 09:53PM

37
#114 - Sarang Khim / @sarang_khim

07/27/2022 at 09:14AM

37
#115 - 1 des frr fourmis / @frrfourmi

06/17/2023 at 02:47PM

37
#116 - kn95 / @phyque_zz

07/16/2023 at 03:05AM

37
#117 - Milan Blažek / @Somin13

09/06/2023 at 03:13PM

37
#118 - Fabrizio Perria / @FPerria

11/05/2023 at 08:15AM

38
#119 - Divvy C. / @divvy_c

08/11/2023 at 10:54PM

39
#120 - Leon Si / @leonzalion

01/24/2021 at 02:56AM