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

324 active golfers, 1402 entries

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

12/10/2022 at 10:40PM

34
#62 - Marco Meinardi / @Kee__no

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

34
#65 - moh ayaya / @AyayaMoh

08/25/2023 at 04:17PM

34
#66 - MonkieeBoi / @MonkieeBoi

11/22/2023 at 06:43AM

34
#67 - seunghyun2269 / @seunghyun2269

11/28/2023 at 05:12PM

34
#68 - Bernhard Gstrein / @ac_ber

12/04/2023 at 12:30PM

34
#69 - satake0916 / @satake0916

01/01/2024 at 12:25PM

34
#70 - Berel94 / @Berel94

03/08/2024 at 05:42PM

34
#71 - tk555 / @tk55513

05/04/2024 at 05:43AM

34
#72 - Aly Thobani / @alythobani

05/29/2024 at 08:10AM

34
#73 - Peppa Pig / @PeppaPigSg

06/12/2024 at 05:33AM

34
#74 - Hector Bjernersjö / @HectorBjernersjo

07/10/2024 at 11:51AM

35
#75 - Dmitry Antonyuk / @dm_antonyuk

12/29/2020 at 07:43AM

35
#76 - Björn Struckmeier / @BjrnStruckmeie1

01/04/2021 at 11:16AM

35
#77 - Sergei Blinov / @awnion

01/17/2021 at 03:13AM

35
#78 - Tinko Minko / @tandikula

01/24/2021 at 08:17AM

35
#79 - Duncan / @Duncan31503119

02/07/2021 at 02:32AM

35
#80 - roudens / @roudens2

03/03/2021 at 02:25AM

35
#81 - Paul Adlene / @AdlenePaul

03/14/2021 at 09:25AM

35
#82 - Kha Nguyen / @__ngtrongkha

06/04/2021 at 08:44AM

35
#83 - Matrices Matlab #1 / @matrices_matlab

07/13/2021 at 06:44PM

35
#84 - Bspammer / @Bspammer

08/15/2021 at 02:12PM

35
#85 - Michel Viktor / @tomkpz

09/22/2021 at 08:59PM

35
#86 - philip / @philip5530

03/03/2022 at 01:14PM

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

04/21/2022 at 09:17AM

35
#88 - Alex / @AlexanderHeatl2

07/06/2022 at 07:48PM

35
#89 - satetheus-vimgolf / @SVimgolf

07/26/2022 at 05:56PM

35
#90 - z00master / @z00master

08/11/2022 at 04:12PM