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

153 active golfers, 659 entries

Leaderboard (lowest score wins):
53
#121 - max / @max_vimaster

06/25/2021 at 09:40AM

54
#122 - Faizan Ansari / @faizan_157

01/31/2021 at 02:30PM

54
#123 - Matthew Jurenka / @JurenkaMatthew

02/13/2021 at 10:57AM

54
#124 - Yttriferous / @YttriferousDev

05/25/2021 at 08:48AM

54
#125 - お-せ-よ- / @OhSayYo

07/23/2021 at 09:57PM

55
#126 - Fabrizio Perria / @FPerria

12/27/2020 at 09:45AM

55
#127 - Matt / @woodfell

02/19/2021 at 05:43AM

56
#128 - Laura Skillington / @lauraskills1

01/12/2021 at 10:56PM

57
#129 - Jacques Donnelly / @Donnll

01/05/2021 at 05:28PM

58
#130 - samodostal / @samodostal

08/02/2021 at 12:41PM

58
#131 - Андрей Осипенко / @os1penko_andrey

10/20/2021 at 06:34PM

59
#132 - WladDalwM / @WladDalwM

03/01/2021 at 10:40AM

59
#133 - A White Dwarf / @AWhiteDwarf1

06/28/2021 at 07:57PM

59
#134 - Rick de chez Gnous / @GnousRick

07/09/2021 at 10:26AM

60
#135 - Sarthak Gupta / @saarthxk

08/02/2021 at 08:34PM

61
#136 - yancy / @yancy_dong

09/17/2021 at 11:06AM

62
#137 - Danny Sanchez / @Dane1410s

03/13/2021 at 05:56PM

63
#138 - Josh Swift / @Swiftyfish14

02/18/2021 at 04:18PM

66
#139 - Bharath / @Bharath15952517

12/12/2020 at 06:23PM

67
#140 - xd noob / @xd_noobs

05/30/2021 at 12:07AM

68
#141 - editor3D / @editor3D

07/13/2021 at 04:48PM

69
#142 - Lakhan Hake / @hake_lakhan

02/21/2021 at 01:58PM

69
#143 - Mathias Chunnoo / @chunnoomathias

03/03/2021 at 10:48AM

69
#144 - Patrick Gates / @patrickgates

06/19/2021 at 09:08PM

72
#145 - Zihang Xia / @Xia_Zihang

01/29/2021 at 05:42AM

75
#146 - Kapildev Neupane / @KapildevNeupane

01/01/2021 at 11:39AM

118
#147 - Wojciech Matuszewski / @wm_matuszewski

02/07/2021 at 06:38AM

124
#148 - kijete3127 / @kijete3127

12/13/2020 at 01:39PM

143
#149 - said / @said13664960

12/17/2020 at 03:36PM

146
#150 - Oleg / @Oleg36601324

03/02/2021 at 01:35PM