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

154 active golfers, 675 entries

Leaderboard (lowest score wins):
34
#31 - a b c / @abc41115243

03/12/2021 at 04:34PM

34
#32 - pikjes / @pikjes2

03/20/2021 at 08:54PM

34
#33 - Arya Kumar / @SusSquirrel

05/16/2021 at 04:38PM

34
#34 - Peter Salvi / @salvipeter

05/19/2021 at 02:12PM

34
#35 - Michael / @Michael62785035

05/24/2021 at 08:12PM

34
#36 - vim_maxter / @MaxterVim

07/05/2021 at 07:17AM

34
#37 - 悟史 / @A1OBJTxN5fTg5EJ

07/13/2021 at 05:05PM

34
#38 - BarePotato / @BarePotato

07/13/2021 at 11:33PM

34
#39 - Alex / @Ergho

07/13/2021 at 11:33PM

34
#40 - Hourann Lin / @HourannLin

08/05/2021 at 03:47PM

34
#41 - Roman Privalov / @RomanPrivalov

08/23/2021 at 05:13PM

34
#42 - vimgolf_vinz / @VimgolfV

09/27/2021 at 08:33PM

34
#43 - Benny Boy / @bennyboy999

10/02/2021 at 07:29PM

34
#44 - Denis / @dkol2000

10/21/2021 at 07:53AM

35
#45 - Dmitry Antonyuk / @AntonyukDmitry

12/29/2020 at 07:43AM

35
#46 - Björn Struckmeier / @BjrnStruckmeie1

01/04/2021 at 11:16AM

35
#47 - Sergei Blinov / @awnion

01/17/2021 at 03:13AM

35
#48 - Tinko Minko / @tandikula

01/24/2021 at 08:17AM

35
#49 - Duncan / @Duncan31503119

02/07/2021 at 02:32AM

35
#50 - roudens / @roudens2

03/03/2021 at 02:25AM

35
#51 - Paul Adlene / @AdlenePaul

03/14/2021 at 09:25AM

35
#52 - Trong Kha Nguyen / @__ngtrongkha

06/04/2021 at 08:44AM

35
#53 - Matrices Matlab #1 / @matrices_matlab

07/13/2021 at 06:44PM

35
#54 - Bspammer / @Bspammer

08/15/2021 at 02:12PM

35
#55 - Michel Viktor / @tomkpz

09/22/2021 at 08:59PM

36
#56 - Filipe Brandenburger / @filbranden

12/10/2020 at 07:27PM

36
#57 - Vahan / @Vahan00900245

10/06/2021 at 01:03PM

37
#58 - Demian Martinez / @demianuco

12/10/2020 at 12:17PM

37
#59 - Daniel Steinberg / @dstein64

12/10/2020 at 05:24PM

37
#60 - Ray Dennis / @raysden

01/11/2021 at 02:52PM