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 5fd623f3cf017601b2b63cbc

Making 3 line function a one liner.

Simple challenge for frequent action while programming.

Start file
Pixel *operator[](Position p) {
    return &pixels[p.getc()][p.getr()];
}
End file
Pixel *operator[](Position p) { return &pixels[p.getc()][p.getr()]; }

View Diff

1,3c1
< Pixel *operator[](Position p) {
<     return &pixels[p.getc()][p.getr()];
< }
---
> Pixel *operator[](Position p) { return &pixels[p.getc()][p.getr()]; }

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 59 remaining solutions by signing in and submitting your own entry
#60 tom / @marlow_th - Score: 15 - 05/07/21 @ 03:54
jdwi<BS> <Esc>A <Del><Esc>:wq<CR>

0 comments


Created by: @fedjagolf

60 active golfers, 78 entries

Leaderboard (lowest score wins):
4
#31 - ever0de / @ever0de

06/02/2021 at 05:43AM

4
#32 - sean choi / @joosting

06/03/2021 at 02:10AM

4
#33 - Andreas Siegrist / @andreaszwei

06/16/2021 at 03:58PM

4
#34 - grosa / @_grosa_

06/21/2021 at 04:20AM

4
#35 - Keshav Chakravarthy / @kaashev

06/27/2021 at 05:35AM

4
#36 - A White Dwarf / @AWhiteDwarf1

06/28/2021 at 09:55PM

4
#37 - Maorun / @Maorun11

06/30/2021 at 07:44AM

4
#38 - Georg Bökman / @BokmanGeorg

07/03/2021 at 03:07PM

4
#39 - Liu ko / @liukonst

07/06/2021 at 07:47PM

4
#40 - sap / @sap38838304

07/08/2021 at 05:03PM

4
#41 - editor3D / @editor3D

07/13/2021 at 04:29PM

4
#42 - 悟史 / @A1OBJTxN5fTg5EJ

07/13/2021 at 04:42PM

4
#43 - Miles Edland / @asmilespeaks

07/14/2021 at 12:40AM

4
#44 - ThatGuyWithAWeirdHat / @Mousakaaa

07/16/2021 at 10:18PM

4
#45 - Rick de chez Gnous / @GnousRick

07/19/2021 at 12:21PM

4
#46 - Yondonjamts Ganzorig / @yondonjamts_g

07/24/2021 at 09:06AM

4
#47 - Russell Helmstedter / @RHelmstedter

07/28/2021 at 04:56PM

4
#48 - lydxn / @lydxn1

07/29/2021 at 04:32AM

4
#49 - Peter Pandorum / @PeterPandorum

08/08/2021 at 12:19PM

4
#50 - Armand Coretchi / @armandcoretchi_

08/13/2021 at 03:35PM

4
#51 - mevmev / @mevmev8

08/21/2021 at 03:11PM

4
#52 - Neil Butler / @PinkyinParis

08/23/2021 at 01:48AM

4
#53 - Miłosz Łakomy / @foobar01123

08/23/2021 at 06:54AM

4
#54 - Dmitry Antonyuk / @AntonyukDmitry

08/24/2021 at 03:51PM

4
#55 - Captain Proton / @CaptainProton5

09/03/2021 at 09:43PM

4
#56 - heyotetsuo / @heyotetsuo

09/11/2021 at 01:42PM

5
#57 - qixiao / @qixiao986

05/31/2021 at 03:28AM

6
#58 - lafwaN / @lafwxN

05/24/2021 at 04:42AM

6
#59 - Joe Farnsworth / @JoeFarnsworth

06/21/2021 at 06:42PM

15
#60 - tom / @marlow_th

05/07/2021 at 03:54AM