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):
54
#241 - Faizan Ansari / @faizan_157

01/31/2021 at 02:30PM

54
#242 - Matthew Jurenka / @JurenkaMatthew

02/13/2021 at 10:57AM

54
#243 - Yttriferous / @YttriferousDev

05/25/2021 at 08:48AM

54
#244 - おせよ / @OhSayYo

07/23/2021 at 09:57PM

54
#245 - ebrahim / @ebraHabashy

04/23/2022 at 05:33AM

54
#246 - MerryElvira / @ElviraBTC

10/01/2022 at 05:22AM

54
#247 - 0xdaydream / @0xdaydream_

01/07/2023 at 01:38PM

54
#248 - David Johnston / @nuts4nuts4nuts

03/26/2023 at 01:56AM

54
#249 - FirstModus / @Nolimimer

03/26/2023 at 09:12PM

55
#250 - Matt / @woodfell

02/19/2021 at 05:43AM

55
#251 - quasineutral / @quasineutral

08/09/2023 at 04:25AM

56
#252 - Laura Skillington / @lauraskills1

01/12/2021 at 10:56PM

56
#253 - Akira MAEZAWA / @zawazaw

08/19/2022 at 02:07PM

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

09/24/2022 at 06:08PM

56
#255 - Duy nguyễn / @Duycld03

07/19/2023 at 07:37PM

57
#256 - Jacques Donnelly / @Donnll

01/05/2021 at 05:28PM

57
#257 - Bharath Hegde / @BharathIHegdeI

01/18/2022 at 03:24PM

57
#258 - Fedleder / @fedleder

04/25/2022 at 06:42PM

57
#259 - sampletext5 / @sampletext5

11/28/2023 at 05:56PM

58
#260 - samodostal / @samodostal

08/02/2021 at 12:41PM

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

10/20/2021 at 06:34PM

58
#262 - Animal Haus / @AanimalHauss

10/24/2022 at 11:10PM

58
#263 - Emre / @Emredinho61

11/23/2023 at 05:43PM

58
#264 - Falafel / @RandomGuy3015

11/29/2023 at 12:50PM

58
#265 - K. Uihlein / @kuihlein

11/29/2023 at 12:50PM

58
#266 - vanshika-agarwal / @vanshika-agarwal

11/29/2023 at 10:13PM

59
#267 - WladDalwM / @WladDalwM

03/01/2021 at 10:40AM

59
#268 - A White Dwarf / @AWhiteDwarf1

06/28/2021 at 07:57PM

59
#269 - Rick de chez Gnous / @GnousRick

07/09/2021 at 10:26AM

59
#270 - Cyrus Kirk / @cyrusjkirk

02/02/2023 at 06:12PM