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

0 comments


Created by: @fedjagolf

81 active golfers, 116 entries

Leaderboard (lowest score wins):
4
#61 - Tim Varley / @varleti

10/12/2021 at 01:10PM

4
#62 - Tanzeel Kazi / @tanzeelkazi

10/12/2021 at 05:50PM

4
#63 - vimgolfleo / @vimgolfleo1

10/15/2021 at 02:53PM

4
#64 - Андрей Осипенко / @os1penko_andrey

10/20/2021 at 06:07PM

4
#65 - Hommels / @pseudohommels

10/26/2021 at 03:48AM

4
#66 - John Other / @john_other

10/31/2021 at 07:35PM

4
#67 - Goose / @Goose_Yang

11/02/2021 at 07:29AM

4
#68 - chaotic / @laersn

11/04/2021 at 10:49AM

4
#69 - Max Muster / @musterm0815

11/16/2021 at 11:37AM

4
#70 - Hydrazar / @hydrazar

11/16/2021 at 02:33PM

4
#71 - WhyIsThisFishInMyEar / @why_ear

11/21/2021 at 12:50AM

4
#72 - Matthew Beaumont / @mattybeau_dev

11/27/2021 at 04:37PM

4
#73 - BESSENG A IREH Guy / @guybesseng

12/14/2021 at 04:04PM

4
#74 - yxke / @_yxke

12/17/2021 at 12:18PM

4
#75 - Selvaganapathy P / @canabady

12/31/2021 at 01:33PM

5
#76 - qixiao / @qixiao986

05/31/2021 at 03:28AM

5
#77 - dog / @coldplayingsong

11/02/2021 at 06:57PM

6
#78 - lafwaN / @lafwxN

05/24/2021 at 04:42AM

6
#79 - Joe Farnsworth / @JoeFarnsworth

06/21/2021 at 06:42PM

6
#80 - rakshith 🦄 / @rakshithbellare

12/28/2021 at 04:10PM

15
#81 - tom / @marlow_th

05/07/2021 at 03:54AM