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

187 active golfers, 815 entries

Leaderboard (lowest score wins):
42
#91 - Yochem van Rosmalen / @yoch3m

01/30/2022 at 08:22PM

43
#92 - TripleL / @TripleL84426373

03/13/2021 at 03:19PM

43
#93 - Patrick Martin / @PatrickDMartin

06/29/2021 at 09:50AM

43
#94 - François / @mortyZZ

07/26/2021 at 07:34PM

43
#95 - Nick Repetti / @nick_repetti

09/21/2021 at 01:09AM

43
#96 - Matthias Bartsch 🏠 / @MBartsch

02/20/2022 at 12:59PM

43
#97 - pu๊b / @rtapayahc

03/03/2022 at 06:14PM

44
#98 - jirgn / @jirgn

12/10/2020 at 09:08PM

44
#99 - Gunter Kluge / @KlugeGunter

01/08/2021 at 09:05PM

44
#100 - Arryue / @Arryue2

01/17/2021 at 02:43AM

44
#101 - Yondonjamts Ganzorig / @yondonjamts_g

01/21/2021 at 07:43PM

44
#102 - OtterPy / @OtterPy

01/26/2021 at 05:39PM

44
#103 - Blake Tereau / @BlakeTereau

02/10/2021 at 06:06PM

44
#104 - Shivam Sharma / @getshivam

03/03/2021 at 12:44PM

44
#105 - omer vishlitzky / @OVishlitzky

03/20/2021 at 11:07AM

44
#106 - grosa / @_grosa_

06/09/2021 at 04:14AM

44
#107 - Der Natsch / @dernatsch

12/07/2021 at 06:24PM

44
#108 - ดิว - รุจิภาส / @deadbook60

03/03/2022 at 08:29AM

44
#109 - แฟน___คนโปรด / @WannaPlayGame_

03/03/2022 at 09:24AM

44
#110 - tarotbybye / @tarotbybyeart

03/03/2022 at 11:28AM

44
#111 - Javier Contreras / @contranton

05/04/2022 at 07:09PM

45
#112 - Łukasz / @srokadev

03/18/2021 at 11:11AM

45
#113 - Captain Proton / @CaptainProton5

06/21/2021 at 11:53AM

45
#114 - iBhagwan / @iiBhagwan

07/07/2021 at 04:21AM

45
#115 - Thitichote Chaimuang / @ThitichoteC

03/03/2022 at 09:05AM

45
#116 - seenz / @lefton_sean

05/14/2022 at 09:10PM

46
#117 - pherapont / @pherapont1

12/20/2020 at 07:35AM

46
#118 - AAbraxas / @AAbraxas1

02/05/2021 at 08:50PM

46
#119 - SwordSwordSwordBird / @SwordSwordBird

02/21/2021 at 07:50AM

46
#120 - Neil Butler / @PinkyinParis

08/23/2021 at 02:38AM