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 5e3c99466ea90a00096b2efb

Add text at some column

Complete golang struct statement.

Start file
// Product contains information about one product
type Product struct
    ID  int64   id
    Name    string  name
    Info    string  info,omitempty
    Price   float64 price
End file
// Product contains information about one product
type Product struct {
    ID  int64   `json:"id"`
    Name    string  `json:"name"`
    Info    string  `json:"info,omitempty"`
    Price   float64 `json:"price"`
}

View Diff

2,6c2,7
< type Product struct
<     ID  int64   id
<     Name    string  name
<     Info    string  info,omitempty
<     Price   float64 price
---
> type Product struct {
>     ID  int64   `json:"id"`
>     Name    string  `json:"name"`
>     Info    string  `json:"info,omitempty"`
>     Price   float64 `json:"price"`
> }

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 19 remaining solutions by signing in and submitting your own entry
#20 Jonathan Skeate / @jskeate - Score: 39 - 02/09/20 @ 20:05
jA {<Esc>Go}<Esc><<qqk03wi`json:"<Esc>A"`<Esc>q@q@q@qZZ

0 comments


Created by: @xiote2

20 active golfers, 50 entries

Leaderboard (lowest score wins):
31
#1 - Saki Gw / @Sakigw

02/07/2020 at 12:54PM

31
#2 - John Braxler / @braxler

02/07/2020 at 06:46PM

31
#3 - Jon Krause / @jkrause314

02/08/2020 at 05:34AM

31
#4 - dryaurtis / @dryaurtis

02/08/2020 at 10:02PM

31
#5 - Romain Heller / @Rom1deTroyes

02/13/2020 at 10:13PM

31
#6 - Matthew / @Burfield12

02/18/2020 at 04:59AM

31
#7 - howanto / @ho_wan_

02/21/2020 at 01:07AM

32
#8 - Smylers / @Smylers2

02/06/2020 at 11:27PM

32
#9 - Kyle X. Clark / @KyXr_Clark

02/07/2020 at 03:28AM

32
#10 - Falafel Palapel / @falafelpalapel

02/15/2020 at 10:17AM

32
#11 - KingYames / @JamesZeHunter

02/17/2020 at 04:44AM

33
#12 - Emil / @emilklindt

02/07/2020 at 07:06AM

33
#13 - garry quested / @GQuested

02/07/2020 at 09:53AM

33
#14 - vimgolf_tmp_2 / @2Vimgolf

02/16/2020 at 05:18PM

34
#15 - xiote / @xiote2

02/06/2020 at 10:57PM

34
#16 - Ollin Boer Bohan / @madebyollin

02/06/2020 at 11:27PM

34
#17 - Walker Boh / @walker_boh

02/07/2020 at 08:46AM

35
#18 - みむら / @rnirnu

02/23/2020 at 08:27AM

38
#19 - Renns / @Renns95250521

02/08/2020 at 10:01AM

39
#20 - Jonathan Skeate / @jskeate

02/09/2020 at 08:05PM