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

54 active golfers, 230 entries

Leaderboard (lowest score wins):
34
#1 - John Braxler / @braxler

12/10/2020 at 04:54PM

34
#2 - Jon Krause / @jkrause314

12/10/2020 at 08:48PM

34
#3 - Smylers / @Smylers2

12/10/2020 at 11:34PM

34
#4 - Ryan Way / @RyanWay16

12/11/2020 at 03:34PM

34
#5 - Vinícius Hoyer / @viniciushoyer

12/11/2020 at 10:23PM

34
#6 - Dax / @zacoxi

12/13/2020 at 12:34PM

34
#7 - Roger Stoltz / @rogsto1

12/13/2020 at 10:32PM

34
#8 - 영훈 / @odjfnrtm

12/16/2020 at 12:46AM

34
#9 - Ian Burgan / @IanBurgan

12/17/2020 at 05:07PM

34
#10 - 김도현 / @pykJzzzsmAzloZl

12/23/2020 at 07:49AM

34
#11 - nigaslivesmatter / @nigaslivesmatt1

12/27/2020 at 04:23PM

34
#12 - Ravi S Sinha / @ambidextrousTx

12/29/2020 at 01:12AM

34
#13 - Jung Yeon Park / @park_jungy

12/30/2020 at 02:40AM

34
#14 - justinhj / @justinhj

12/30/2020 at 08:00PM

34
#15 - bladehaze / @bladehaze

01/03/2021 at 02:45AM

34
#16 - Nicolas Pagny / @NicolasPagny

01/06/2021 at 04:53PM

34
#17 - chocolate / @chocola81394123

01/08/2021 at 05:29AM

34
#18 - A A A / @37fatos

01/09/2021 at 06:37PM

34
#19 - Marion Oldman / @ThatBigCock

01/16/2021 at 10:59PM

34
#20 - traplover / @traplov78528337

01/17/2021 at 01:44PM

34
#21 - Andreas Siegrist / @andreaszwei

01/20/2021 at 11:23AM

35
#22 - Dmitry Antonyuk / @AntonyukDmitry

12/29/2020 at 07:43AM

35
#23 - Björn Struckmeier / @BjrnStruckmeie1

01/04/2021 at 11:16AM

35
#24 - Sergei Blinov / @awnion

01/17/2021 at 03:13AM

36
#25 - Filipe Brandenburger / @filbranden

12/10/2020 at 07:27PM

37
#26 - Demian Martinez / @demianuco

12/10/2020 at 12:17PM

37
#27 - Daniel Steinberg / @dstein64

12/10/2020 at 05:24PM

37
#28 - Ray Dennis / @raysden

01/11/2021 at 02:52PM

40
#29 - mevmev / @mevmev8

12/13/2020 at 01:16AM

41
#30 - Ceda EI / @ceda_ei

12/10/2020 at 12:07PM