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

139 active golfers, 596 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

34
#22 - 蔡徐坤真是爱吃屎 / @Hashub7

02/04/2021 at 02:41PM

34
#23 - Torikatsu / @torikatsu923

02/12/2021 at 05:26PM

34
#24 - せいほう / @FICSQF

02/23/2021 at 09:18AM

34
#25 - Martin LOUAZEL / @Zbrahark

02/24/2021 at 12:35PM

34
#26 - geosucker / @geosucker

02/25/2021 at 05:15PM

34
#27 - Keltanokka / @keltanokka

03/02/2021 at 08:02PM

34
#28 - mandophysics / @mandophysics

03/05/2021 at 10:08PM

34
#29 - der tanzbaer / @der_tanzbaer

03/09/2021 at 03:26PM

34
#30 - maxtong / @maxtong1987

03/12/2021 at 04:32AM