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

323 active golfers, 1400 entries

Leaderboard (lowest score wins):
47
#211 - Ian Horton / @IAMIANHORTON

04/25/2023 at 07:47AM

47
#212 - Peter Szerzo / @peterszerzo

07/03/2023 at 01:44PM

47
#213 - b1gz / @_b1gz

07/16/2023 at 10:39PM

47
#214 - Sepehr / @Sepehration

08/11/2023 at 08:32PM

47
#215 - Waisni / @Waisni

11/29/2023 at 07:13PM

48
#216 - Barabas Raffai / @BarabasRaffai

12/25/2020 at 08:47PM

48
#217 - kafang plays vimgolf / @KafangV

12/26/2020 at 11:45AM

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

01/14/2021 at 11:37PM

48
#219 - Harrison / @ardentcow

07/03/2021 at 01:53AM

48
#220 - Max Muster / @musterm0815

11/16/2021 at 11:50AM

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

03/03/2022 at 01:01PM

48
#222 - e_e / @eleloi

02/12/2023 at 06:16PM

48
#223 - Jordan Woods / @JordanW09204552

07/08/2023 at 05:44PM

49
#224 - 盧小小 / @VegetaLu

04/02/2022 at 10:17AM

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

05/06/2022 at 05:53PM

49
#226 - d44d3w / @d44d3w

03/22/2023 at 03:28AM

49
#227 - Aarya / @aaryabhatia6

05/20/2023 at 02:23AM

50
#228 - Dave Baskind / @davebaskind

10/28/2022 at 08:23AM

50
#229 - Daniel Nettelfield / @DNIIBOY

12/11/2022 at 09:53PM

50
#230 - RosaTryp / @RosaTryp

03/14/2023 at 02:22PM

50
#231 - SmoggyFog / @SmoggyFog

05/30/2023 at 06:36AM

50
#232 - مرجان / @IEnfantTerribIe

08/03/2023 at 04:06PM

51
#233 - Murad / @m_spitfire

12/25/2020 at 04:42PM

51
#234 - Sébastien Lavoie / @sgdlavoie

03/04/2021 at 01:34AM

51
#235 - Omar Alawadhi / @OmarAla59544225

10/21/2022 at 02:25PM

51
#236 - ʋ( = ᴥ =)ʋ / @gianni1986

04/24/2023 at 09:46PM

51
#237 - MrMcX / @MrMcX

11/27/2023 at 09:41AM

52
#238 - Paul Inc / @hiniol1982

02/05/2021 at 07:21PM

52
#239 - yalil kuban / @KubanYalil

02/19/2021 at 03:35PM

52
#240 - ._. / @Katharsic

05/16/2021 at 10:09AM