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):
52
#241 - Chun Chanjun / @CChanjun

11/19/2021 at 03:29PM

52
#242 - some-coder / @somecoder99

07/13/2023 at 12:19AM

52
#243 - Supreme Paudel / @paudsu01

06/03/2024 at 06:23PM

53
#244 - Richard Leigh Davies / @RichardDaviesAI

01/23/2021 at 10:49PM

53
#245 - foobarbazqux12345 / @foobarbazqux121

03/02/2021 at 04:17PM

53
#246 - tom / @marlow_th

05/07/2021 at 04:45AM

53
#247 - Emiliano Vazquez / @vazquezemiliano

05/09/2021 at 04:20AM

53
#248 - models / @zornificator

06/23/2021 at 09:50PM

53
#249 - max / @max_vimaster

06/25/2021 at 09:40AM

53
#250 - pankace / @pankace_Frosted

03/03/2022 at 03:22PM

53
#251 - qyACvBm9H8 / @QyBm9

12/04/2022 at 03:50PM

53
#252 - MC / @MC88686523

03/25/2023 at 01:36PM

53
#253 - jinx balotchnik / @balotchnik

07/22/2023 at 10:36PM

54
#254 - Faizan Ansari / @faizan_157

01/31/2021 at 02:30PM

54
#255 - Matthew Jurenka / @JurenkaMatthew

02/13/2021 at 10:57AM

54
#256 - Yttriferous / @YttriferousDev

05/25/2021 at 08:48AM

54
#257 - おせよ / @OhSayYo

07/23/2021 at 09:57PM

54
#258 - ebrahim / @ebraHabashy

04/23/2022 at 05:33AM

54
#259 - MerryElvira / @ElviraBTC

10/01/2022 at 05:22AM

54
#260 - 0xdaydream / @0xdaydream_

01/07/2023 at 01:38PM

54
#261 - David Johnston / @nuts4nuts4nuts

03/26/2023 at 01:56AM

54
#262 - FirstModus / @Nolimimer

03/26/2023 at 09:12PM

55
#263 - Matt / @woodfell

02/19/2021 at 05:43AM

55
#264 - quasineutral / @quasineutral

08/09/2023 at 04:25AM

56
#265 - Laura Skillington / @lauraskills1

01/12/2021 at 10:56PM

56
#266 - Akira MAEZAWA / @zawazaw

08/19/2022 at 02:07PM

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

09/24/2022 at 06:08PM

56
#268 - Duy nguyễn / @Duycld03

07/19/2023 at 07:37PM

57
#269 - Jacques Donnelly / @Donnll

01/05/2021 at 05:28PM

57
#270 - Bharath Hegde / @BharathIHegdeI

01/18/2022 at 03:24PM