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

0 comments


Created by: @fedjagolf

99 active golfers, 144 entries

Leaderboard (lowest score wins):
5
#91 - qixiao / @qixiao986

05/31/2021 at 03:28AM

5
#92 - dog / @coldplayingsong

11/02/2021 at 06:57PM

6
#93 - lafwaN / @lafwxN

05/24/2021 at 04:42AM

6
#94 - Joe Farnsworth / @JoeFarnsworth

06/21/2021 at 06:42PM

6
#95 - rakshith 🦄 / @rakshithbellare

12/28/2021 at 04:10PM

6
#96 - Adam Dawkins / @adamdawkins

02/17/2022 at 11:02AM

7
#97 - makita0x01 / @Makita81234049

02/22/2022 at 07:01AM

14
#98 - 梅 / @umetosawara

04/12/2022 at 01:12PM

15
#99 - tom / @marlow_th

05/07/2021 at 03:54AM