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

54 active golfers, 233 entries

Leaderboard (lowest score wins):
42
#31 - fedja golf / @fedjagolf

01/15/2021 at 11:08PM

42
#32 - tylertucker202 / @tylertucker202

01/22/2021 at 01:43AM

44
#33 - jirgn / @jirgn

12/10/2020 at 09:08PM

44
#34 - Gunter Kluge / @KlugeGunter

01/08/2021 at 09:05PM

44
#35 - Arryue / @Arryue2

01/17/2021 at 02:43AM

44
#36 - Yondonjamts / @yondonjamts_g

01/21/2021 at 07:43PM

46
#37 - pherapont / @pherapont1

12/20/2020 at 07:35AM

47
#38 - nd183 / @nd1832

12/10/2020 at 09:32AM

47
#39 - 木木 / @rongmazhong

12/11/2020 at 03:31AM

47
#40 - Horst / @Horst91706815

01/20/2021 at 01:34PM

47
#41 - zapakh / @zapakh

01/21/2021 at 05:05AM

48
#42 - Barabas Raffai / @BarabasRaffai

12/25/2020 at 08:47PM

48
#43 - kafang plays vimgolf / @KafangV

12/26/2020 at 11:45AM

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

01/14/2021 at 11:37PM

49
#45 - 蔡徐坤真是爱吃屎 / @Hashub7

01/20/2021 at 01:28PM

51
#46 - Murad / @m_spitfire

12/25/2020 at 04:42PM

55
#47 - Fabrizio Perria / @FPerria

12/27/2020 at 09:45AM

56
#48 - Laura Skillington / @lauraskills1

01/12/2021 at 10:56PM

57
#49 - Jacques Donnelly / @Donnll

01/05/2021 at 05:28PM

66
#50 - Bharath / @Bharath15952517

12/12/2020 at 06:23PM

75
#51 - Kapildev Neupane / @KapildevNeupane

01/01/2021 at 11:39AM

124
#52 - kijete3127 / @kijete3127

12/13/2020 at 01:39PM

143
#53 - said / @said13664960

12/17/2020 at 03:36PM

202
#54 - vesa / @XingfDu

01/14/2021 at 07:02AM