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 223 remaining solutions by signing in and submitting your own entry
#224 Jongsang Tack (Ben) / @BenJongsang - Score: 261 - 09/11/22 @ 15:17
vf>xiauto<Esc>lllllllllxjhhhhhhhhhhh<C-Q>lllllllllllllllllhjjjxklllllllllllllla = <Del><Esc>lllhh:%s/;/,/g<CR>kkkji<BS><Esc>jhhhhhhhhhhi<BS><Esc>jhhhhhhi<BS><Esc>lllllllxhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh/<Esc>:%s/(//g<CR>:%s/)//g<CR>wwwi{ <Esc>$a{<BS>};<Esc>hhhhhhhhhhhhhhhhhhhhhi l<BS><Esc>lllllllli <Esc>lllllllllli <Esc>llllli <Esc>:w<CR>:wq<CR>

0 comments


Created by: @nd1832

224 active golfers, 994 entries

Leaderboard (lowest score wins):
47
#151 - BryanYan / @BryanGoesPlaces

10/17/2021 at 02:45PM

47
#152 - vimgolfaccfekxh / @vimgolfaccfekxh

10/30/2022 at 01:50PM

48
#153 - Barabas Raffai / @BarabasRaffai

12/25/2020 at 08:47PM

48
#154 - kafang plays vimgolf / @KafangV

12/26/2020 at 11:45AM

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

01/14/2021 at 11:37PM

48
#156 - Harrison / @ardentcow

07/03/2021 at 01:53AM

48
#157 - Max Muster / @musterm0815

11/16/2021 at 11:50AM

48
#158 - วทททท / @uhTOWreLzQy0JN5

03/03/2022 at 01:01PM

49
#159 - 盧小小 / @VegetaLu

04/02/2022 at 10:17AM

49
#160 - 𝚋𝚛𝚒𝚊𝚗 / @Brianjp93

05/06/2022 at 05:53PM

50
#161 - Dave Baskind / @davebaskind

10/28/2022 at 08:23AM

51
#162 - Murad / @m_spitfire

12/25/2020 at 04:42PM

51
#163 - Sébastien Lavoie / @sgdlavoie

03/04/2021 at 01:34AM

51
#164 - Omar Alawadhi / @OmarAla59544225

10/21/2022 at 02:25PM

52
#165 - Paul Inc / @hiniol1982

02/05/2021 at 07:21PM

52
#166 - yalil kuban / @KubanYalil

02/19/2021 at 03:35PM

52
#167 - ._. / @Katharsic

05/16/2021 at 10:09AM

52
#168 - Chun Chanjun / @CChanjun

11/19/2021 at 03:29PM

53
#169 - Richard Leigh Davies / @RichardDaviesAI

01/23/2021 at 10:49PM

53
#170 - foobarbazqux12345 / @foobarbazqux121

03/02/2021 at 04:17PM

53
#171 - tom / @marlow_th

05/07/2021 at 04:45AM

53
#172 - Emiliano Vazquez / @vazquezemiliano

05/09/2021 at 04:20AM

53
#173 - models / @zornificator

06/23/2021 at 09:50PM

53
#174 - max / @max_vimaster

06/25/2021 at 09:40AM

53
#175 - pankace / @pankace_Frosted

03/03/2022 at 03:22PM

54
#176 - Faizan Ansari / @faizan_157

01/31/2021 at 02:30PM

54
#177 - Matthew Jurenka / @JurenkaMatthew

02/13/2021 at 10:57AM

54
#178 - Yttriferous / @YttriferousDev

05/25/2021 at 08:48AM

54
#179 - おせよ / @OhSayYo

07/23/2021 at 09:57PM

54
#180 - ebrahim / @ebraHabashy

04/23/2022 at 05:33AM