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):
44
#91 - Shivam Sharma / @getshivam

03/03/2021 at 12:44PM

44
#92 - omer vishlitzky / @OVishlitzky

03/20/2021 at 11:07AM

44
#93 - grosa / @_grosa_

06/09/2021 at 04:14AM

45
#94 - Łukasz / @srokadev

03/18/2021 at 11:11AM

45
#95 - Captain Proton / @CaptainProton5

06/21/2021 at 11:53AM

45
#96 - iBhagwan / @iiBhagwan

07/07/2021 at 04:21AM

46
#97 - pherapont / @pherapont1

12/20/2020 at 07:35AM

46
#98 - AAbraxas / @AAbraxas1

02/05/2021 at 08:50PM

46
#99 - SwordSwordSwordBird / @SwordSwordBird

02/21/2021 at 07:50AM

46
#100 - Neil Butler / @PinkyinParis

08/23/2021 at 02:38AM

47
#101 - nd183 / @nd1832

12/10/2020 at 09:32AM

47
#102 - 木木 / @rongmazhong

12/11/2020 at 03:31AM

47
#103 - Horst / @Horst91706815

01/20/2021 at 01:34PM

47
#104 - zapakh / @zapakh

01/21/2021 at 05:05AM

47
#105 - Ska / @skaa42

07/17/2021 at 09:23AM

47
#106 - Alaris Morissette / @Alaris_Villain

07/30/2021 at 03:37AM

47
#107 - BryanYan / @BryanGoesPlaces

10/17/2021 at 02:45PM

48
#108 - Barabas Raffai / @BarabasRaffai

12/25/2020 at 08:47PM

48
#109 - kafang plays vimgolf / @KafangV

12/26/2020 at 11:45AM

48
#110 - this is for vim golf / @Dis4VimGolf

01/14/2021 at 11:37PM

48
#111 - Harrison / @ardentcow

07/03/2021 at 01:53AM

51
#112 - Murad / @m_spitfire

12/25/2020 at 04:42PM

51
#113 - Sébastien Lavoie / @sgdlavoie

03/04/2021 at 01:34AM

52
#114 - Paul Inc / @hiniol1982

02/05/2021 at 07:21PM

52
#115 - yalil kuban / @KubanYalil

02/19/2021 at 03:35PM

52
#116 - ._. / @Katharsic

05/16/2021 at 10:09AM

53
#117 - Richard Leigh Davies / @RichardDaviesAI

01/23/2021 at 10:49PM

53
#118 - foobarbazqux12345 / @foobarbazqux121

03/02/2021 at 04:17PM

53
#119 - tom / @marlow_th

05/07/2021 at 04:45AM

53
#120 - Emiliano Vazquez / @vazquezemiliano

05/09/2021 at 04:20AM