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 151 remaining solutions by signing in and submitting your own entry
#152 vesa / @XingfDu - Score: 202 - 01/14/21 @ 07:02
jkdaWiauto <Esc>wwi = {  } <BS>j<BS>j<BS><Esc>jd0#$<CR><BS>xxjdaW<Esc>UDU<Esc>Uuuudawdawdwdw$xxjuuuuuuuuuuuujlllll<C-V>jjjbbbdw:s<BS>$<BS>%s/\);<BS><BS><BS>);\n/, \<BS>/g<CR>ddwwr=wpI{ $<BS><Esc>$hx A_<BS>}<Esc>0I<BS> <Esc>HLLJLllllllllllllr i =<Esc>x==Lwwi= <Esc>hhxhx)A;<Esc>:X<CR>:<CR><CR><CR><CR><CR>:X<BS>x<CR>

0 comments


Created by: @nd1832

152 active golfers, 656 entries

Leaderboard (lowest score wins):
37
#61 - treb / @treb03683130

03/12/2021 at 01:13PM

37
#62 - mevmev / @mevmev8

08/18/2021 at 09:52AM

39
#63 - Leon Si / @leonzalion

01/24/2021 at 02:56AM

39
#64 - vimgolf / @vimgolf7

01/25/2021 at 02:30PM

39
#65 - qsdfqsdf / @qsdfqsd83220776

03/04/2021 at 08:08PM

39
#66 - damned-me / @damned_me_

05/25/2021 at 03:22PM

39
#67 - Lee Kian Tat Ken / @thekingtat

06/14/2021 at 03:56PM

40
#68 - Daniel Andersson / @AnderssonDanzig

02/27/2021 at 03:18PM

40
#69 - Lorenzo Bertolino / @lo_bertolino

03/07/2021 at 10:25PM

40
#70 - Markus Muschol / @MarkusMuschol

07/14/2021 at 07:09AM

41
#71 - Ceda EI / @ceda_ei

12/10/2020 at 12:07PM

41
#72 - Laurent Atlan / @laurentatlan1

03/21/2021 at 07:24PM

41
#73 - Kyle / @Kyle98675198

05/30/2021 at 12:47AM

41
#74 - sap / @sap38838304

07/08/2021 at 05:06PM

42
#75 - fedja golf / @fedjagolf

01/15/2021 at 11:08PM

42
#76 - tylertucker202 / @tylertucker202

01/22/2021 at 01:43AM

42
#77 - z_r_a / @z_r_a

02/03/2021 at 05:43AM

42
#78 - Rajit Singh / @rajitbsingh

03/02/2021 at 07:43PM

42
#79 - Sebastien Nicoud / @sebnukem

07/18/2021 at 05:14PM

43
#80 - TripleL / @TripleL84426373

03/13/2021 at 03:19PM

43
#81 - Patrick Martin / @PatrickDMartin

06/29/2021 at 09:50AM

43
#82 - Fran├žois / @mortyZZ

07/26/2021 at 07:34PM

43
#83 - Nick Repetti / @nick_repetti

09/21/2021 at 01:09AM

44
#84 - jirgn / @jirgn

12/10/2020 at 09:08PM

44
#85 - Gunter Kluge / @KlugeGunter

01/08/2021 at 09:05PM

44
#86 - Arryue / @Arryue2

01/17/2021 at 02:43AM

44
#87 - Yondonjamts Ganzorig / @yondonjamts_g

01/21/2021 at 07:43PM

44
#88 - OtterPy / @OtterPy

01/26/2021 at 05:39PM

44
#89 - Blake Tereau / @BlakeTereau

02/10/2021 at 06:06PM

44
#90 - Shivam Sharma / @getshivam

03/03/2021 at 12:44PM