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):
39
#121 - vimgolf / @vimgolf7

01/25/2021 at 02:30PM

39
#122 - qsdfqsdf / @qsdfqsd83220776

03/04/2021 at 08:08PM

39
#123 - damned-me / @damned_me_

05/25/2021 at 03:22PM

39
#124 - Lee Kian Tat Ken / @thekingtat

06/14/2021 at 03:56PM

39
#125 - Jonathan / @engiwengi_

10/22/2022 at 04:23AM

39
#126 - Davinder Jolly / @DavinderJolly

11/29/2023 at 11:36PM

39
#127 - KoroneListener / @KoroneListener

09/04/2024 at 02:33PM

39
#128 - k1mosabe / @k1mosabe

12/03/2024 at 02:40AM

40
#129 - Daniel Andersson / @AnderssonDanzig

02/27/2021 at 03:18PM

40
#130 - Lorenzo Bertolino / @lo_bertolino

03/07/2021 at 10:25PM

40
#131 - Markus Muschol / @MarkusMuschol

07/14/2021 at 07:09AM

40
#132 - Yannick / @Yannick88147038

07/19/2022 at 07:38PM

41
#133 - Ceda EI / @ceda_ei

12/10/2020 at 12:07PM

41
#134 - Laurent Atlan / @laurentatlan1

03/21/2021 at 07:24PM

41
#135 - Kyle / @Kyle98675198

05/30/2021 at 12:47AM

41
#136 - ShookerAndBeta / @Shooker2012

06/05/2022 at 05:50PM

41
#137 - Florian Leitner / @flowing

12/06/2022 at 11:02PM

41
#138 - usermod / @g_usermod

02/06/2023 at 01:27AM

41
#139 - Jay Solana / @JaySolana3

02/07/2023 at 06:12AM

41
#140 - Иван / @wansmer

04/20/2023 at 07:41PM

41
#141 - Adrián Fidalgo-Díaz / @adrianFD22

12/17/2023 at 03:31PM

42
#142 - fedja golf / @fedjagolf

01/15/2021 at 11:08PM

42
#143 - tylertucker202 / @tylertucker202

01/22/2021 at 01:43AM

42
#144 - z_r_a / @z_r_a

02/03/2021 at 05:43AM

42
#145 - Rajit Singh / @rajitbsingh

03/02/2021 at 07:43PM

42
#146 - Sebastien Nicoud / @sebnukem

07/18/2021 at 05:14PM

42
#147 - Yochem van Rosmalen / @yoch3m

01/30/2022 at 08:22PM

42
#148 - Alex Lewin / @_AlexLewin

07/12/2022 at 03:16AM

42
#149 - Spam Mail / @mrfdot

05/26/2023 at 02:25AM

42
#150 - someone / @IKvacenok

06/13/2023 at 06:45PM