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

225 active golfers, 999 entries

Leaderboard (lowest score wins):
72
#211 - Zihang Xia / @Xia_Zihang

01/29/2021 at 05:42AM

75
#212 - Kapildev Neupane / @KapildevNeupane

01/01/2021 at 11:39AM

79
#213 - rakshith 🦄 / @rakshithbellare

12/29/2021 at 12:38PM

84
#214 - Driver / @zhouyijiaren

06/18/2022 at 08:43AM

97
#215 - 탁종상 / @redkokkalkon

09/12/2022 at 01:11PM

114
#216 - grim reefer / @LordKingGoof

04/02/2022 at 12:24AM

118
#217 - Wojciech Matuszewski / @wm_matuszewski

02/07/2021 at 06:38AM

124
#218 - kijete3127 / @kijete3127

12/13/2020 at 01:39PM

143
#219 - said / @said13664960

12/17/2020 at 03:36PM

146
#220 - Oleg / @Oleg36601324

03/02/2021 at 01:35PM

153
#221 - Milad ABC / @miladdarren

02/16/2021 at 07:43AM

165
#222 - vimfan / @vimfan1

02/04/2021 at 07:11PM

202
#223 - vesa / @XingfDu

01/14/2021 at 07:02AM

219
#224 - inseac_xyz_vimgolf / @InseacV

10/16/2022 at 05:24PM

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

09/11/2022 at 03:17PM