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

283 active golfers, 1208 entries

Leaderboard (lowest score wins):
41
#121 - Jay Solana / @JaySolana3

02/07/2023 at 06:12AM

41
#122 - Иван / @wansmer

04/20/2023 at 07:41PM

42
#123 - fedja golf / @fedjagolf

01/15/2021 at 11:08PM

42
#124 - tylertucker202 / @tylertucker202

01/22/2021 at 01:43AM

42
#125 - z_r_a / @z_r_a

02/03/2021 at 05:43AM

42
#126 - Rajit Singh / @rajitbsingh

03/02/2021 at 07:43PM

42
#127 - Sebastien Nicoud / @sebnukem

07/18/2021 at 05:14PM

42
#128 - Yochem van Rosmalen / @yoch3m

01/30/2022 at 08:22PM

42
#129 - Alex Lewin / @_AlexLewin

07/12/2022 at 03:16AM

42
#130 - Spam Mail / @mrfdot

05/26/2023 at 02:25AM

42
#131 - Игорь Квачёнок / @IKvacenok

06/13/2023 at 06:45PM

42
#132 - jasonlee / @jasonle61136657

06/15/2023 at 10:38AM

43
#133 - TripleL / @TripleL84426373

03/13/2021 at 03:19PM

43
#134 - Patrick Martin / @PatrickDMartin

06/29/2021 at 09:50AM

43
#135 - François / @mortyZZ

07/26/2021 at 07:34PM

43
#136 - Nick Repetti / @nick_repetti

09/21/2021 at 01:09AM

43
#137 - Matthias Bartsch 🏠 / @MBartsch

02/20/2022 at 12:59PM

43
#138 - pu๊b / @rtapayahc

03/03/2022 at 06:14PM

43
#139 - James / @Dronak

11/18/2022 at 09:21PM

43
#140 - キムラ・OPEL・ユウジ / @kimurayuuji79

11/22/2022 at 12:28AM

43
#141 - dakmuk / @yeongha_yang

01/02/2023 at 12:52PM

43
#142 - Injae Kang / @abcinje

07/14/2023 at 05:14PM

44
#143 - jirgn / @jirgn

12/10/2020 at 09:08PM

44
#144 - Gunter Kluge / @KlugeGunter

01/08/2021 at 09:05PM

44
#145 - Arryue / @Arryue2

01/17/2021 at 02:43AM

44
#146 - Yondonjamts Ganzorig / @yondonjamts_g

01/21/2021 at 07:43PM

44
#147 - OtterPy / @OtterPy

01/26/2021 at 05:39PM

44
#148 - Blake Tereau / @BlakeTereau

02/10/2021 at 06:06PM

44
#149 - Shivam Sharma / @getshivam

03/03/2021 at 12:44PM

44
#150 - omer vishlitzky / @OVishlitzky

03/20/2021 at 11:07AM