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):
54
#181 - MerryElvira / @ElviraBTC

10/01/2022 at 05:22AM

55
#182 - Fabrizio Perria / @FPerria

12/27/2020 at 09:45AM

55
#183 - Matt / @woodfell

02/19/2021 at 05:43AM

56
#184 - Laura Skillington / @lauraskills1

01/12/2021 at 10:56PM

56
#185 - Akira MAEZAWA / @zawazaw

08/19/2022 at 02:07PM

56
#186 - Никита Семёнов / @NiKoS1707

09/24/2022 at 06:08PM

57
#187 - Jacques Donnelly / @Donnll

01/05/2021 at 05:28PM

57
#188 - Bharath Hegde / @BharathIHegdeI

01/18/2022 at 03:24PM

57
#189 - Fedleder / @fedleder

04/25/2022 at 06:42PM

58
#190 - samodostal / @samodostal

08/02/2021 at 12:41PM

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

10/20/2021 at 06:34PM

58
#192 - Animal Haus / @AanimalHauss

10/24/2022 at 11:10PM

59
#193 - WladDalwM / @WladDalwM

03/01/2021 at 10:40AM

59
#194 - A White Dwarf / @AWhiteDwarf1

06/28/2021 at 07:57PM

59
#195 - Rick de chez Gnous / @GnousRick

07/09/2021 at 10:26AM

60
#196 - Sarthak Gupta / @saarthxk

08/02/2021 at 08:34PM

61
#197 - Siddharth Murali / @SidTweetsALess

07/19/2022 at 05:16AM

61
#198 - Nanne Wielinga / @NanneWielinga

07/26/2022 at 05:28PM

62
#199 - Danny Sanchez / @Dane1410s

03/13/2021 at 05:56PM

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

02/09/2022 at 12:02PM

63
#201 - Josh Swift / @Swiftyfish14

02/18/2021 at 04:18PM

66
#202 - Bharath / @Bharath15952517

12/12/2020 at 06:23PM

67
#203 - poly000 / @_poly000

05/30/2021 at 12:07AM

68
#204 - editor3D / @editor3D

07/13/2021 at 04:48PM

68
#205 - スー / @suesanjp_dev

09/16/2022 at 09:30AM

69
#206 - Lakhan Hake / @hake_lakhan

02/21/2021 at 01:58PM

69
#207 - Mathias Chunnoo / @chunnoomathias

03/03/2021 at 10:48AM

69
#208 - Patrick Gates / @patrickgates

06/19/2021 at 09:08PM

70
#209 - aravindthangavel / @aravindpt

04/11/2022 at 02:58AM

72
#210 - Zihang Xia / @Xia_Zihang

01/29/2021 at 05:42AM