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 59384eb3652ee111a0000001

From argument to object

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

Start file
organize(cupboard, 3, 2);
prioritize
(bureau, 8, 7);
realize
(bannister, 4, 4);
moralize
(railing, 3,9);
End file
cupboard.organize(3, 2);
bureau
.prioritize(8, 7);
bannister
.realize(4, 4);
railing
.moralize(3,9);

View Diff

1,4c1,4
< organize(cupboard, 3, 2);
< prioritize(bureau, 8, 7);
< realize(bannister, 4, 4);
< moralize(railing, 3,9);
---
> cupboard.organize(3, 2);
> bureau.prioritize(8, 7);
> bannister.realize(4, 4);
> railing.moralize(3,9);

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 459 remaining solutions by signing in and submitting your own entry
#460 William Dankspeare / @will_dankspeare - Score: 81 - 06/29/17 @ 17:31
c2w<Esc>ux2w<Esc>uwwdwxx0P<Esc>uuuu0d2w<Esc>uww10x0Pvhc.<Esc><Esc>jww8x0Pvhc.<Esc>jww11x0Pvhc.<Esc>j9x0Pvhc.<Esc>:wq<CR>

0 comments


Created by: @toddagibson

460 active golfers, 1513 entries

Leaderboard (lowest score wins):
33
#451 - Ryan Tran / @BlueAccords

10/19/2017 at 08:01PM

33
#452 - Chirag Joshi / @thechijos

08/14/2018 at 06:59AM

33
#453 - 伺か / @ojiry

08/30/2018 at 10:46AM

38
#454 - toddagibson / @toddagibson

06/07/2017 at 07:08PM

38
#455 - Di Peng / @DCodier

11/03/2018 at 02:02AM

51
#456 - Sathyanarayanan Vaithianathan / @Sathyan88697115

09/12/2022 at 04:32AM

54
#457 - Richard_ / @richardwlaub

06/15/2017 at 07:02PM

54
#458 - Sahil Shetty / @sahildshetty

09/10/2022 at 01:09AM

80
#459 - Steven Oxley / @xonev

06/09/2017 at 05:24AM

81
#460 - William Dankspeare / @will_dankspeare

06/29/2017 at 05:31PM