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 @nelser_by:

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

200 active golfers, 312 entries

Solutions by @nelser_by:
4
#60 - Михаил Чупринский / @nelser_by

10/09/2021 at 02:27PM

5
#>178 - Михаил Чупринский / @nelser_by

10/09/2021 at 02:26PM

7
#>190 - Михаил Чупринский / @nelser_by

10/09/2021 at 02:24PM

8
#>191 - Михаил Чупринский / @nelser_by

10/09/2021 at 02:22PM

9
#>192 - Михаил Чупринский / @nelser_by

10/09/2021 at 02:22PM