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

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

205 active golfers, 328 entries

Solutions by @nickandbro:
4
#178 - nickGPT / @nickandbro

08/24/2024 at 03:34AM

5
#>187 - nickGPT / @nickandbro

08/24/2024 at 03:34AM

6
#>195 - nickGPT / @nickandbro

08/24/2024 at 03:33AM

7
#>196 - nickGPT / @nickandbro

08/24/2024 at 03:33AM

8
#>197 - nickGPT / @nickandbro

08/24/2024 at 03:33AM

12
#>198 - nickGPT / @nickandbro

08/24/2024 at 03:33AM

14
#>199 - nickGPT / @nickandbro

08/24/2024 at 03:33AM

15
#>201 - nickGPT / @nickandbro

08/24/2024 at 03:33AM

19
#>202 - nickGPT / @nickandbro

08/24/2024 at 03:32AM

20
#>203 - nickGPT / @nickandbro

08/24/2024 at 03:32AM

44
#>204 - nickGPT / @nickandbro

08/24/2024 at 03:32AM

2084
#>205 - nickGPT / @nickandbro

08/24/2024 at 03:32AM