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

224 active golfers, 994 entries

Leaderboard (lowest score wins):
35
#61 - Björn Struckmeier / @BjrnStruckmeie1

01/04/2021 at 11:16AM

35
#62 - Sergei Blinov / @awnion

01/17/2021 at 03:13AM

35
#63 - Tinko Minko / @tandikula

01/24/2021 at 08:17AM

35
#64 - Duncan / @Duncan31503119

02/07/2021 at 02:32AM

35
#65 - roudens / @roudens2

03/03/2021 at 02:25AM

35
#66 - Paul Adlene / @AdlenePaul

03/14/2021 at 09:25AM

35
#67 - Kha Nguyen / @__ngtrongkha

06/04/2021 at 08:44AM

35
#68 - Matrices Matlab #1 / @matrices_matlab

07/13/2021 at 06:44PM

35
#69 - Bspammer / @Bspammer

08/15/2021 at 02:12PM

35
#70 - Michel Viktor / @tomkpz

09/22/2021 at 08:59PM

35
#71 - philip / @philip5530

03/03/2022 at 01:14PM

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

04/21/2022 at 09:17AM

35
#73 - Alex / @AlexanderHeatl2

07/06/2022 at 07:48PM

35
#74 - satetheus-vimgolf / @SVimgolf

07/26/2022 at 05:56PM

35
#75 - z00master / @z00master

08/11/2022 at 04:12PM

35
#76 - Bangash💉💉 / @DevotionGeo

10/10/2022 at 02:55PM

36
#77 - Filipe Brandenburger / @filbranden

12/10/2020 at 07:27PM

36
#78 - Vahan / @Vahan00900245

10/06/2021 at 01:03PM

36
#79 - POSIX / @po6ix

01/08/2022 at 05:00AM

36
#80 - quemeraisc / @quemeraisc

05/17/2022 at 02:05PM

36
#81 - Janzen / @__Coos

10/07/2022 at 08:44AM

37
#82 - Demian Martinez / @demianuco

12/10/2020 at 12:17PM

37
#83 - Dan / @dstein64

12/10/2020 at 05:24PM

37
#84 - Ray Dennis / @raysden

01/11/2021 at 02:52PM

37
#85 - Askhento / @Askhento1

01/27/2021 at 01:29AM

37
#86 - treb / @treb03683130

03/12/2021 at 01:13PM

37
#87 - mevmev / @mevmev8

08/18/2021 at 09:52AM

37
#88 - Felix Linhardt / @FelixLinhardt

03/20/2022 at 09:53PM

37
#89 - Sarang Khim / @sarang_khim

07/27/2022 at 09:14AM

39
#90 - Leon Si / @leonzalion

01/24/2021 at 02:56AM