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

260 active golfers, 1102 entries

Leaderboard (lowest score wins):
34
#61 - Zion Park / @zionpark93

12/10/2022 at 10:40PM

34
#62 - Marco Meinardi / @chino_meinardi

12/30/2022 at 02:48PM

34
#63 - reo101 / @reo101gamer

03/25/2023 at 10:53PM

34
#64 - Ted / @TodorDukov

03/26/2023 at 11:39AM

35
#65 - Dmitry Antonyuk / @dm_antonyuk

12/29/2020 at 07:43AM

35
#66 - Björn Struckmeier / @BjrnStruckmeie1

01/04/2021 at 11:16AM

35
#67 - Sergei Blinov / @awnion

01/17/2021 at 03:13AM

35
#68 - Tinko Minko / @tandikula

01/24/2021 at 08:17AM

35
#69 - Duncan / @Duncan31503119

02/07/2021 at 02:32AM

35
#70 - roudens / @roudens2

03/03/2021 at 02:25AM

35
#71 - Paul Adlene / @AdlenePaul

03/14/2021 at 09:25AM

35
#72 - Kha Nguyen / @__ngtrongkha

06/04/2021 at 08:44AM

35
#73 - Matrices Matlab #1 / @matrices_matlab

07/13/2021 at 06:44PM

35
#74 - Bspammer / @Bspammer

08/15/2021 at 02:12PM

35
#75 - Michel Viktor / @tomkpz

09/22/2021 at 08:59PM

35
#76 - philip / @philip5530

03/03/2022 at 01:14PM

35
#77 - スティーン@ニーツ / @raxmur

04/21/2022 at 09:17AM

35
#78 - Alex / @AlexanderHeatl2

07/06/2022 at 07:48PM

35
#79 - satetheus-vimgolf / @SVimgolf

07/26/2022 at 05:56PM

35
#80 - z00master / @z00master

08/11/2022 at 04:12PM

35
#81 - Bangash💉💉 / @DevotionGeo

10/10/2022 at 02:55PM

35
#82 - elhoc / @elhoc2

02/14/2023 at 03:50PM

35
#83 - sap / @sap38838304

04/26/2023 at 04:44AM

36
#84 - Filipe Brandenburger / @filbranden

12/10/2020 at 07:27PM

36
#85 - Vahan / @Vahan00900245

10/06/2021 at 01:03PM

36
#86 - POSIX / @po6ix

01/08/2022 at 05:00AM

36
#87 - quemeraisc / @quemeraisc

05/17/2022 at 02:05PM

36
#88 - Janzen / @__Coos

10/07/2022 at 08:44AM

37
#89 - Demian Martinez / @demianuco

12/10/2020 at 12:17PM

37
#90 - Dan / @dstein64

12/10/2020 at 05:24PM