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

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 51 remaining solutions by signing in and submitting your own entry
#52 tom / @marlow_th - Score: 15 - 05/07/21 @ 03:54
jdwi<BS> <Esc>A <Del><Esc>:wq<CR>

0 comments


Created by: @fedjagolf

52 active golfers, 65 entries

Leaderboard (lowest score wins):
4
#1 - r4d1um / @r4d1um

12/13/2020 at 03:06PM

4
#2 - Jon Krause / @jkrause314

12/13/2020 at 04:44PM

4
#3 - Smylers / @Smylers2

12/13/2020 at 05:28PM

4
#4 - Roger Stoltz / @rogsto1

12/13/2020 at 10:02PM

4
#5 - Vinícius Hoyer / @viniciushoyer

12/14/2020 at 01:22PM

4
#6 - Dax / @zacoxi

12/15/2020 at 02:20AM

4
#7 - Ryan Way / @RyanWay16

12/15/2020 at 05:17AM

4
#8 - Miki Tebeka / @tebeka

12/16/2020 at 07:08AM

4
#9 - John Braxler / @braxler

12/17/2020 at 07:05PM

4
#10 - RaylanFox / @RaylanFox

12/19/2020 at 05:34PM

4
#11 - Filipe Brandenburger / @filbranden

12/21/2020 at 05:14AM

4
#12 - hepebexè / @hepebexe

01/09/2021 at 09:21PM

4
#13 - Tinko Minko / @tandikula

01/18/2021 at 10:45AM

4
#14 - A A A / @37fatos

02/01/2021 at 12:36AM

4
#15 - Jung Yeon Park / @park_jungy

02/16/2021 at 11:17PM

4
#16 - Duy Arsenal / @hotboyarsenal

02/23/2021 at 04:40AM

4
#17 - 김범준 / @kmbmjn

03/10/2021 at 08:02AM

4
#18 - Laurent Atlan / @laurentatlan1

03/21/2021 at 06:45PM

4
#19 - Tuure / @tuure_p

03/22/2021 at 02:47AM

4
#20 - AAbraxas / @AAbraxas1

03/22/2021 at 07:46PM

4
#21 - Eric Söderström / @eksoderstrom

03/25/2021 at 04:02PM

4
#22 - Mobius / @ManiacalMobius

05/10/2021 at 11:23PM

4
#23 - Popescu Silviu / @PopescuSilviu

05/13/2021 at 12:51PM

4
#24 - nedlog / @nedlog18

05/14/2021 at 06:47AM

4
#25 - ._. / @Katharsic

05/16/2021 at 09:27AM

4
#26 - Arya Kumar / @SusSquirrel

05/16/2021 at 04:04PM

4
#27 - :wq / @write_quit_22

05/18/2021 at 05:40PM

4
#28 - roudens / @roudens2

05/22/2021 at 02:42PM

4
#29 - Kurtis D. Miller / @phdkurt

05/26/2021 at 05:23PM

4
#30 - Youngchan Lee / @edwardycl

06/02/2021 at 05:41AM