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):
42
#151 - jasonlee / @jasonle61136657

06/15/2023 at 10:38AM

43
#152 - TripleL / @TripleL84426373

03/13/2021 at 03:19PM

43
#153 - Patrick Martin / @PatrickDMartin

06/29/2021 at 09:50AM

43
#154 - François / @mortyZZ

07/26/2021 at 07:34PM

43
#155 - Nick Repetti / @nick_repetti

09/21/2021 at 01:09AM

43
#156 - Matthias Bartsch 🏠 / @MBartsch

02/20/2022 at 12:59PM

43
#157 - pu๊b / @rtapayahc

03/03/2022 at 06:14PM

43
#158 - James / @Dronak

11/18/2022 at 09:21PM

43
#159 - キムラ・OPEL・ユウジ / @kimurayuuji79

11/22/2022 at 12:28AM

43
#160 - dakmuk / @yeongha_yang

01/02/2023 at 12:52PM

43
#161 - Injae Kang / @abcinje

07/14/2023 at 05:14PM

43
#162 - jonas-grobe / @jonas-grobe

02/01/2024 at 10:02PM

43
#163 - かみひろ / @km_hr

03/10/2024 at 09:01AM

43
#164 - Brice Bischoff / @B-Bischoff

11/07/2024 at 01:08PM

44
#165 - jirgn / @jirgn

12/10/2020 at 09:08PM

44
#166 - Gunter Kluge / @KlugeGunter

01/08/2021 at 09:05PM

44
#167 - Arryue / @Arryue2

01/17/2021 at 02:43AM

44
#168 - Yondonjamts Ganzorig / @yondonjamts_g

01/21/2021 at 07:43PM

44
#169 - OtterPy / @OtterPy

01/26/2021 at 05:39PM

44
#170 - Blake Tereau / @BlakeTereau

02/10/2021 at 06:06PM

44
#171 - Shivam Sharma / @getshivam

03/03/2021 at 12:44PM

44
#172 - omer vishlitzky / @OVishlitzky

03/20/2021 at 11:07AM

44
#173 - grosa / @_grosa_

06/09/2021 at 04:14AM

44
#174 - Der Natsch / @dernatsch

12/07/2021 at 06:24PM

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

03/03/2022 at 08:29AM

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

03/03/2022 at 09:24AM

44
#177 - tarotbybye / @tarotbybyeart

03/03/2022 at 11:28AM

44
#178 - Javier Contreras / @contranton

05/04/2022 at 07:09PM

44
#179 - steve / @steve35773420

05/27/2022 at 02:24AM

44
#180 - DW Luna / @dcheed_

12/21/2022 at 09:20PM