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

307 active golfers, 1333 entries

Leaderboard (lowest score wins):
59
#271 - D G G / @DGJourneyman

02/21/2023 at 08:42AM

60
#272 - Sarthak Gupta / @saarthxk

08/02/2021 at 08:34PM

60
#273 - rayx / @ray-x

12/09/2023 at 09:36AM

61
#274 - Siddharth Murali / @SidTweetsALess

07/19/2022 at 05:16AM

61
#275 - Nanne Wielinga / @NanneWielinga

07/26/2022 at 05:28PM

62
#276 - Danny Sanchez / @Dane1410s

03/13/2021 at 05:56PM

62
#277 - Даня Ефимов / @Abberatus

02/09/2022 at 12:02PM

63
#278 - Josh Swift / @Swiftyfish14

02/18/2021 at 04:18PM

65
#279 - ysw505 / @ysw505

01/15/2024 at 03:28PM

66
#280 - Bharath / @Bharath15952517

12/12/2020 at 06:23PM

67
#281 - poly000 / @_poly000

05/30/2021 at 12:07AM

67
#282 - Benjamin / @BenjaminBashar

02/12/2023 at 10:44PM

67
#283 - ashkan / @ashkanMc

05/12/2023 at 11:34PM

68
#284 - editor3D / @editor3D

07/13/2021 at 04:48PM

68
#285 - スー / @suesanjp_dev

09/16/2022 at 09:30AM

69
#286 - Lakhan Hake / @hake_lakhan

02/21/2021 at 01:58PM

69
#287 - Mathias Chunnoo / @chunnoomathias

03/03/2021 at 10:48AM

69
#288 - Patrick Gates / @patrickgates

06/19/2021 at 09:08PM

70
#289 - aravindthangavel / @aravindpt

04/11/2022 at 02:58AM

72
#290 - Zihang Xia / @Xia_Zihang

01/29/2021 at 05:42AM

75
#291 - Kapildev Neupane / @KapildevNeupane

01/01/2021 at 11:39AM

79
#292 - rakshith 🦄 / @rakshithbellare

12/29/2021 at 12:38PM

83
#293 - janor140 / @janor140

11/25/2023 at 05:18PM

84
#294 - Driver / @zhouyijiaren

06/18/2022 at 08:43AM

84
#295 - marcelborbus / @marcelborbus

03/03/2024 at 06:54PM

97
#296 - 탁종상 / @redkokkalkon

09/12/2022 at 01:11PM

114
#297 - grim reefer / @LordKingGoof

04/02/2022 at 12:24AM

118
#298 - Wojciech Matuszewski / @wm_matuszewski

02/07/2021 at 06:38AM

124
#299 - kijete3127 / @kijete3127

12/13/2020 at 01:39PM

143
#300 - said / @said13664960

12/17/2020 at 03:36PM