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

118 active golfers, 509 entries

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

01/15/2021 at 11:08PM

42
#62 - tylertucker202 / @tylertucker202

01/22/2021 at 01:43AM

42
#63 - z_r_a / @z_r_a

02/03/2021 at 05:43AM

42
#64 - Rajit Singh / @rajitbsingh

03/02/2021 at 07:43PM

43
#65 - TripleL / @TripleL84426373

03/13/2021 at 03:19PM

44
#66 - jirgn / @jirgn

12/10/2020 at 09:08PM

44
#67 - Gunter Kluge / @KlugeGunter

01/08/2021 at 09:05PM

44
#68 - Arryue / @Arryue2

01/17/2021 at 02:43AM

44
#69 - Yondonjamts / @yondonjamts_g

01/21/2021 at 07:43PM

44
#70 - OtterPy / @OtterPy

01/26/2021 at 05:39PM

44
#71 - Blake Tereau / @BlakeTereau

02/10/2021 at 06:06PM

44
#72 - Shivam Sharma / @getshivam

03/03/2021 at 12:44PM

44
#73 - omer vishlitzky / @OVishlitzky

03/20/2021 at 11:07AM

44
#74 - grosa / @_grosa_

06/09/2021 at 04:14AM

45
#75 - Łukasz / @srokadev

03/18/2021 at 11:11AM

46
#76 - pherapont / @pherapont1

12/20/2020 at 07:35AM

46
#77 - AAbraxas / @AAbraxas1

02/05/2021 at 08:50PM

46
#78 - SwordSwordSwordBird / @SwordSwordBird

02/21/2021 at 07:50AM

47
#79 - nd183 / @nd1832

12/10/2020 at 09:32AM

47
#80 - 木木 / @rongmazhong

12/11/2020 at 03:31AM

47
#81 - Horst / @Horst91706815

01/20/2021 at 01:34PM

47
#82 - zapakh / @zapakh

01/21/2021 at 05:05AM

48
#83 - Barabas Raffai / @BarabasRaffai

12/25/2020 at 08:47PM

48
#84 - kafang plays vimgolf / @KafangV

12/26/2020 at 11:45AM

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

01/14/2021 at 11:37PM

51
#86 - Murad / @m_spitfire

12/25/2020 at 04:42PM

51
#87 - Sébastien Lavoie / @sgdlavoie

03/04/2021 at 01:34AM

52
#88 - Paul Inc / @hiniol1982

02/05/2021 at 07:21PM

52
#89 - yalil kuban / @KubanYalil

02/19/2021 at 03:35PM

52
#90 - ._. / @Katharsic

05/16/2021 at 10:09AM