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

261 active golfers, 1103 entries

Leaderboard (lowest score wins):
54
#211 - MerryElvira / @ElviraBTC

10/01/2022 at 05:22AM

54
#212 - 0xdaydream / @0xdaydream_

01/07/2023 at 01:38PM

54
#213 - David Johnston / @nuts4nuts4nuts

03/26/2023 at 01:56AM

54
#214 - FirstModus / @Nolimimer

03/26/2023 at 09:12PM

55
#215 - Fabrizio Perria / @FPerria

12/27/2020 at 09:45AM

55
#216 - Matt / @woodfell

02/19/2021 at 05:43AM

56
#217 - Laura Skillington / @lauraskills1

01/12/2021 at 10:56PM

56
#218 - Akira MAEZAWA / @zawazaw

08/19/2022 at 02:07PM

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

09/24/2022 at 06:08PM

57
#220 - Jacques Donnelly / @Donnll

01/05/2021 at 05:28PM

57
#221 - Bharath Hegde / @BharathIHegdeI

01/18/2022 at 03:24PM

57
#222 - Fedleder / @fedleder

04/25/2022 at 06:42PM

58
#223 - samodostal / @samodostal

08/02/2021 at 12:41PM

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

10/20/2021 at 06:34PM

58
#225 - Animal Haus / @AanimalHauss

10/24/2022 at 11:10PM

59
#226 - WladDalwM / @WladDalwM

03/01/2021 at 10:40AM

59
#227 - A White Dwarf / @AWhiteDwarf1

06/28/2021 at 07:57PM

59
#228 - Rick de chez Gnous / @GnousRick

07/09/2021 at 10:26AM

59
#229 - Cyrus Kirk / @cyrusjkirk

02/02/2023 at 06:12PM

59
#230 - D G G / @DGJourneyman

02/21/2023 at 08:42AM

60
#231 - Sarthak Gupta / @saarthxk

08/02/2021 at 08:34PM

61
#232 - Siddharth Murali / @SidTweetsALess

07/19/2022 at 05:16AM

61
#233 - Nanne Wielinga / @NanneWielinga

07/26/2022 at 05:28PM

62
#234 - Danny Sanchez / @Dane1410s

03/13/2021 at 05:56PM

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

02/09/2022 at 12:02PM

63
#236 - Josh Swift / @Swiftyfish14

02/18/2021 at 04:18PM

66
#237 - Bharath / @Bharath15952517

12/12/2020 at 06:23PM

67
#238 - poly000 / @_poly000

05/30/2021 at 12:07AM

67
#239 - Benjamin / @BenjaminBashar

02/12/2023 at 10:44PM

67
#240 - ashkan / @ashkanMc

05/12/2023 at 11:34PM