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 by @jsumskas:

Unlock 5 remaining solutions by signing in and submitting your own entry
Created by: @fedjagolf

199 active golfers, 311 entries

Solutions by @jsumskas:
4
#147 - Joshua Sumskas / @jsumskas

07/16/2023 at 03:39AM

5
#>181 - Joshua Sumskas / @jsumskas

07/16/2023 at 03:38AM

6
#>189 - Joshua Sumskas / @jsumskas

07/16/2023 at 03:37AM

9
#>191 - Joshua Sumskas / @jsumskas

07/16/2023 at 03:29AM

14
#>193 - Joshua Sumskas / @jsumskas

07/16/2023 at 03:27AM