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):
18
#241 - Brendan B Amdocs / @AmdocsB

11/06/2018 at 03:45PM

18
#242 - name / @name65894813

11/15/2018 at 07:02PM

18
#243 - abgalphabet / @abgalphabet

01/22/2019 at 12:31PM

18
#244 - TimMcGuire / @mcguire

02/04/2019 at 07:08PM

18
#245 - 默罕默德 / @Rt6RjEAJ987Woes

02/19/2019 at 09:34AM

18
#246 - james_bunch / @james_bunch

04/20/2019 at 08:00AM

18
#247 - T / @tea_sea

05/03/2019 at 08:48AM

18
#248 - Sherab Giovannini / @shaddycls

05/03/2019 at 08:46PM

18
#249 - Nick Yeow / @nickyeow

05/24/2019 at 02:59PM

18
#250 - Neil Struthers / @struthersneil

07/18/2019 at 04:30PM

18
#251 - Chris Shorrock / @EbinFlow

08/17/2019 at 06:29PM

18
#252 - kevinski / @kevinsk30746831

08/22/2019 at 01:42PM

18
#253 - vimRunnerUp3000 / @VUp3000

09/02/2019 at 06:36PM

18
#254 - Lory / @Lory46845742

11/08/2019 at 02:00PM

18
#255 - pysnow530 / @pysnow530

11/25/2019 at 02:59PM

18
#256 - Rishabh Chatterjee / @RishabhChatte14

12/23/2019 at 04:37PM

18
#257 - Rui Xue / @ruirayxue

12/27/2019 at 05:50PM

18
#258 - 김범준 / @kmbmjn

02/06/2020 at 05:58AM

18
#259 - Ryan Nevius / @ryannevius

03/26/2020 at 08:28PM

18
#260 - iBhagwan / @iiBhagwan

05/14/2020 at 10:55PM

18
#261 - hepebexè / @hepebexe

12/13/2020 at 08:24PM

18
#262 - roudens / @roudens2

01/13/2021 at 12:28AM

18
#263 - mevmev / @mevmev8

09/20/2021 at 05:04PM

18
#264 - Jean George / @JeanGeo20504212

09/23/2021 at 07:56PM

18
#265 - vimgolfaccfekxh / @vimgolfaccfekxh

10/30/2022 at 04:07PM

18
#266 - Divvy C. / @divvy_c

08/13/2023 at 01:02PM

18
#267 - Luoyb / @Luoyb

11/16/2023 at 05:27AM

18
#268 - MikkelDitlevOlsen1 / @MikkelDitlevOlsen1

01/08/2024 at 10:59PM

18
#269 - jonas-grobe / @jonas-grobe

02/03/2024 at 08:21PM

18
#270 - かみひろ / @km_hr

03/04/2024 at 02:24PM