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

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

Solutions by @PauliTaipale:

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

183 active golfers, 290 entries

Solutions by @PauliTaipale:
#97 - Pauli Taipale / @PauliTaipale

07/07/2022 at 11:59PM