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

81 active golfers, 332 entries

Leaderboard (lowest score wins):
51
#61 - Murad / @m_spitfire

12/25/2020 at 04:42PM

52
#62 - Paul Inc / @hiniol1982

02/05/2021 at 07:21PM

52
#63 - yalil kuban / @KubanYalil

02/19/2021 at 03:35PM

53
#64 - Richard Leigh Davies / @RichardDaviesAI

01/23/2021 at 10:49PM

54
#65 - Faizan Ansari / @faizan_157

01/31/2021 at 02:30PM

54
#66 - Matthew Jurenka / @JurenkaMatthew

02/13/2021 at 10:57AM

55
#67 - Fabrizio Perria / @FPerria

12/27/2020 at 09:45AM

55
#68 - Matt / @woodfell

02/19/2021 at 05:43AM

56
#69 - Laura Skillington / @lauraskills1

01/12/2021 at 10:56PM

57
#70 - Jacques Donnelly / @Donnll

01/05/2021 at 05:28PM

63
#71 - Josh Swift / @Swiftyfish14

02/18/2021 at 04:18PM

66
#72 - Bharath / @Bharath15952517

12/12/2020 at 06:23PM

69
#73 - Lakhan Hake / @hake_lakhan

02/21/2021 at 01:58PM

72
#74 - Zihang Xia / @Xia_Zihang

01/29/2021 at 05:42AM

75
#75 - Kapildev Neupane / @KapildevNeupane

01/01/2021 at 11:39AM

118
#76 - Wojciech Matuszewski / @wm_matuszewski

02/07/2021 at 06:38AM

124
#77 - kijete3127 / @kijete3127

12/13/2020 at 01:39PM

143
#78 - said / @said13664960

12/17/2020 at 03:36PM

153
#79 - Milad ABC / @miladdarren

02/16/2021 at 07:43AM

165
#80 - vimfan / @vimfan1

02/04/2021 at 07:11PM

202
#81 - vesa / @XingfDu

01/14/2021 at 07:02AM