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):
69
#301 - Lakhan Hake / @hake_lakhan

02/21/2021 at 01:58PM

69
#302 - Mathias Chunnoo / @chunnoomathias

03/03/2021 at 10:48AM

69
#303 - Patrick Gates / @patrickgates

06/19/2021 at 09:08PM

70
#304 - aravindthangavel / @aravindpt

04/11/2022 at 02:58AM

70
#305 - nickGPT / @nickandbro

08/24/2024 at 03:39AM

72
#306 - Zihang Xia / @Xia_Zihang

01/29/2021 at 05:42AM

75
#307 - Kapildev Neupane / @KapildevNeupane

01/01/2021 at 11:39AM

79
#308 - rakshith 🦄 / @rakshithbellare

12/29/2021 at 12:38PM

83
#309 - janor140 / @janor140

11/25/2023 at 05:18PM

84
#310 - Driver / @zhouyijiaren

06/18/2022 at 08:43AM

84
#311 - marcelborbus / @marcelborbus

03/03/2024 at 06:54PM

97
#312 - 탁종상 / @redkokkalkon

09/12/2022 at 01:11PM

114
#313 - grim reefer / @LordKingGoof

04/02/2022 at 12:24AM

118
#314 - Wojciech Matuszewski / @wm_matuszewski

02/07/2021 at 06:38AM

124
#315 - kijete3127 / @kijete3127

12/13/2020 at 01:39PM

143
#316 - said / @said13664960

12/17/2020 at 03:36PM

146
#317 - Oleg / @Oleg36601324

03/02/2021 at 01:35PM

153
#318 - Milad ABC / @miladdarren

02/16/2021 at 07:43AM

165
#319 - vimfan / @vimfan1

02/04/2021 at 07:11PM

174
#320 - RNG Shine / @RNGShine

11/27/2023 at 11:35AM

202
#321 - vesa / @XingfDu

01/14/2021 at 07:02AM

219
#322 - inseac_xyz_vimgolf / @InseacV

10/16/2022 at 05:24PM

261
#323 - Jongsang Tack (Ben) / @BenJongsang

09/11/2022 at 03:17PM