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):
34
#1 - John Braxler / @braxler

12/10/2020 at 04:54PM

34
#2 - Jon Krause / @jkrause314

12/10/2020 at 08:48PM

34
#3 - "Smylers" / @Smylers2

12/10/2020 at 11:34PM

34
#4 - Ryan Way / @RyanWay16

12/11/2020 at 03:34PM

34
#5 - Vinícius Hoyer / @viniciushoyer

12/11/2020 at 10:23PM

34
#6 - Dax / @zacoxi

12/13/2020 at 12:34PM

34
#7 - Roger Stoltz / @rogsto1

12/13/2020 at 10:32PM

34
#8 - 영훈 / @odjfnrtm

12/16/2020 at 12:46AM

34
#9 - Ian Burgan / @IanBurgan

12/17/2020 at 05:07PM

34
#10 - 김도현 / @pykJzzzsmAzloZl

12/23/2020 at 07:49AM

34
#11 - nigaslivesmatter / @nigaslivesmatt1

12/27/2020 at 04:23PM

34
#12 - Ravi S Sinha / @ambidextrousTx

12/29/2020 at 01:12AM

34
#13 - Jung Yeon Park / @park_jungy

12/30/2020 at 02:40AM

34
#14 - justinhj / @justinhj

12/30/2020 at 08:00PM

34
#15 - bladehaze / @bladehaze

01/03/2021 at 02:45AM

34
#16 - Nicolas Pagny / @NicolasPagny

01/06/2021 at 04:53PM

34
#17 - chocolate / @chocola81394123

01/08/2021 at 05:29AM

34
#18 - A A A / @37fatos

01/09/2021 at 06:37PM

34
#19 - Marion Oldman / @ThatBigCock

01/16/2021 at 10:59PM

34
#20 - traplover / @traplov78528337

01/17/2021 at 01:44PM

34
#21 - Andreas Siegrist / @andreaszwei

01/20/2021 at 11:23AM

34
#22 - 蔡徐坤真是爱吃屎 / @Hashub7

02/04/2021 at 02:41PM

34
#23 - Torikatsu / @torikatsu923

02/12/2021 at 05:26PM

34
#24 - せいほう / @FICSQF

02/23/2021 at 09:18AM

34
#25 - Martin LOUAZEL / @Zbrahark

02/24/2021 at 12:35PM

34
#26 - geosucker / @geosucker

02/25/2021 at 05:15PM

34
#27 - Keltanokka / @keltanokka

03/02/2021 at 08:02PM

34
#28 - mandophysics / @mandophysics

03/05/2021 at 10:08PM

34
#29 - der tanzbaer / @der_tanzbaer

03/09/2021 at 03:26PM

34
#30 - maxtong / @maxtong1987

03/12/2021 at 04:32AM