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

227 active golfers, 1006 entries

Leaderboard (lowest score wins):
39
#91 - Leon Si / @leonzalion

01/24/2021 at 02:56AM

39
#92 - vimgolf / @vimgolf7

01/25/2021 at 02:30PM

39
#93 - qsdfqsdf / @qsdfqsd83220776

03/04/2021 at 08:08PM

39
#94 - damned-me / @damned_me_

05/25/2021 at 03:22PM

39
#95 - Lee Kian Tat Ken / @thekingtat

06/14/2021 at 03:56PM

39
#96 - Jonathan / @engiwengi_

10/22/2022 at 04:23AM

40
#97 - Daniel Andersson / @AnderssonDanzig

02/27/2021 at 03:18PM

40
#98 - Lorenzo Bertolino / @lo_bertolino

03/07/2021 at 10:25PM

40
#99 - Markus Muschol / @MarkusMuschol

07/14/2021 at 07:09AM

40
#100 - Yannick / @Yannick88147038

07/19/2022 at 07:38PM

41
#101 - Ceda EI / @ceda_ei

12/10/2020 at 12:07PM

41
#102 - Laurent Atlan / @laurentatlan1

03/21/2021 at 07:24PM

41
#103 - Kyle / @Kyle98675198

05/30/2021 at 12:47AM

41
#104 - sap / @sap38838304

07/08/2021 at 05:06PM

41
#105 - ShookerAndBeta / @Shooker2012

06/05/2022 at 05:50PM

41
#106 - Florian Leitner / @flowing

12/06/2022 at 11:02PM

42
#107 - fedja golf / @fedjagolf

01/15/2021 at 11:08PM

42
#108 - tylertucker202 / @tylertucker202

01/22/2021 at 01:43AM

42
#109 - z_r_a / @z_r_a

02/03/2021 at 05:43AM

42
#110 - Rajit Singh / @rajitbsingh

03/02/2021 at 07:43PM

42
#111 - Sebastien Nicoud / @sebnukem

07/18/2021 at 05:14PM

42
#112 - Yochem van Rosmalen / @yoch3m

01/30/2022 at 08:22PM

42
#113 - Alex Lewin / @_AlexLewin

07/12/2022 at 03:16AM

43
#114 - TripleL / @TripleL84426373

03/13/2021 at 03:19PM

43
#115 - Patrick Martin / @PatrickDMartin

06/29/2021 at 09:50AM

43
#116 - François / @mortyZZ

07/26/2021 at 07:34PM

43
#117 - Nick Repetti / @nick_repetti

09/21/2021 at 01:09AM

43
#118 - Matthias Bartsch 🏠 / @MBartsch

02/20/2022 at 12:59PM

43
#119 - pu๊b / @rtapayahc

03/03/2022 at 06:14PM

43
#120 - James / @Dronak

11/18/2022 at 09:21PM