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):
57
#271 - Fedleder / @fedleder

04/25/2022 at 06:42PM

57
#272 - sampletext5 / @sampletext5

11/28/2023 at 05:56PM

57
#273 - 海は深いぞ / @thisway_forward

07/08/2024 at 02:46PM

58
#274 - samodostal / @samodostal

08/02/2021 at 12:41PM

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

10/20/2021 at 06:34PM

58
#276 - Animal Haus / @AanimalHauss

10/24/2022 at 11:10PM

58
#277 - Emre / @Emredinho61

11/23/2023 at 05:43PM

58
#278 - Falafel / @RandomGuy3015

11/29/2023 at 12:50PM

58
#279 - K. Uihlein / @kuihlein

11/29/2023 at 12:50PM

58
#280 - vanshika-agarwal / @vanshika-agarwal

11/29/2023 at 10:13PM

59
#281 - WladDalwM / @WladDalwM

03/01/2021 at 10:40AM

59
#282 - A White Dwarf / @AWhiteDwarf1

06/28/2021 at 07:57PM

59
#283 - Rick de chez Gnous / @GnousRick

07/09/2021 at 10:26AM

59
#284 - Cyrus Kirk / @cyrusjkirk

02/02/2023 at 06:12PM

59
#285 - D G G / @DGJourneyman

02/21/2023 at 08:42AM

60
#286 - Sarthak Gupta / @saarthxk

08/02/2021 at 08:34PM

60
#287 - rayx / @ray-x

12/09/2023 at 09:36AM

61
#288 - Siddharth Murali / @SidTweetsALess

07/19/2022 at 05:16AM

61
#289 - Nanne Wielinga / @NanneWielinga

07/26/2022 at 05:28PM

62
#290 - Danny Sanchez / @Dane1410s

03/13/2021 at 05:56PM

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

02/09/2022 at 12:02PM

63
#292 - Josh Swift / @Swiftyfish14

02/18/2021 at 04:18PM

65
#293 - ysw505 / @ysw505

01/15/2024 at 03:28PM

66
#294 - Bharath / @Bharath15952517

12/12/2020 at 06:23PM

67
#295 - poly000 / @_poly000

05/30/2021 at 12:07AM

67
#296 - Benjamin / @BenjaminBashar

02/12/2023 at 10:44PM

67
#297 - ashkan / @ashkanMc

05/12/2023 at 11:34PM

68
#298 - editor3D / @editor3D

07/13/2021 at 04:48PM

68
#299 - スー / @suesanjp_dev

09/16/2022 at 09:30AM

68
#300 - Yash Kulshrestha / @YashdalfTheGray

04/27/2024 at 06:35PM