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

117 active golfers, 506 entries

Leaderboard (lowest score wins):
53
#91 - Richard Leigh Davies / @RichardDaviesAI

01/23/2021 at 10:49PM

53
#92 - foobarbazqux12345 / @foobarbazqux121

03/02/2021 at 04:17PM

53
#93 - tom / @marlow_th

05/07/2021 at 04:45AM

53
#94 - Emiliano Vazquez / @vazquezemiliano

05/09/2021 at 04:20AM

54
#95 - Faizan Ansari / @faizan_157

01/31/2021 at 02:30PM

54
#96 - Matthew Jurenka / @JurenkaMatthew

02/13/2021 at 10:57AM

54
#97 - Yttriferous / @YttriferousDev

05/25/2021 at 08:48AM

55
#98 - Fabrizio Perria / @FPerria

12/27/2020 at 09:45AM

55
#99 - Matt / @woodfell

02/19/2021 at 05:43AM

56
#100 - Laura Skillington / @lauraskills1

01/12/2021 at 10:56PM

57
#101 - Jacques Donnelly / @Donnll

01/05/2021 at 05:28PM

59
#102 - WladDalwM / @WladDalwM

03/01/2021 at 10:40AM

62
#103 - Danny Sanchez / @Dane1410s

03/13/2021 at 05:56PM

63
#104 - Josh Swift / @Swiftyfish14

02/18/2021 at 04:18PM

66
#105 - Bharath / @Bharath15952517

12/12/2020 at 06:23PM

67
#106 - xd noob / @xd_noobs

05/30/2021 at 12:07AM

69
#107 - Lakhan Hake / @hake_lakhan

02/21/2021 at 01:58PM

69
#108 - Mathias Chunnoo / @chunnoomathias

03/03/2021 at 10:48AM

72
#109 - Zihang Xia / @Xia_Zihang

01/29/2021 at 05:42AM

75
#110 - Kapildev Neupane / @KapildevNeupane

01/01/2021 at 11:39AM

118
#111 - Wojciech Matuszewski / @wm_matuszewski

02/07/2021 at 06:38AM

124
#112 - kijete3127 / @kijete3127

12/13/2020 at 01:39PM

143
#113 - said / @said13664960

12/17/2020 at 03:36PM

146
#114 - Oleg / @Oleg36601324

03/02/2021 at 01:35PM

153
#115 - Milad ABC / @miladdarren

02/16/2021 at 07:43AM

165
#116 - vimfan / @vimfan1

02/04/2021 at 07:11PM

202
#117 - vesa / @XingfDu

01/14/2021 at 07:02AM