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

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

195 active golfers, 306 entries

Solutions by @SidTweetsALess:
4
#96 - Siddharth Murali / @SidTweetsALess

06/25/2022 at 01:31PM

4
#>96 - Siddharth Murali / @SidTweetsALess

06/25/2022 at 01:33PM

5
#>175 - Siddharth Murali / @SidTweetsALess

06/25/2022 at 01:30PM

7
#>187 - Siddharth Murali / @SidTweetsALess

06/25/2022 at 01:29PM

13
#>189 - Siddharth Murali / @SidTweetsALess

06/25/2022 at 01:23PM

18
#>192 - Siddharth Murali / @SidTweetsALess

06/25/2022 at 01:18PM

18
#>192 - Siddharth Murali / @SidTweetsALess

06/25/2022 at 01:22PM

22
#>193 - Siddharth Murali / @SidTweetsALess

06/25/2022 at 01:21PM