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 64 remaining solutions by signing in and submitting your own entry
#65 Tuure / @tuure_p - Score: 47 - 03/24/21 @ 01:28
o}<Esc>ddGp:3,6s/$/"`<CR>fpi`json:"<Esc>lyBkPkBPkBPka {<Esc>ZZ

0 comments


Created by: @xiote2

65 active golfers, 173 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

31
#8 - countime / @countime1

03/09/2020 at 10:17AM

31
#9 - Sean Dewar / @seandewar

03/13/2020 at 10:35PM

31
#10 - Roger Stoltz / @rogsto1

03/20/2020 at 11:03PM

31
#11 - Filipe Brandenburger / @filbranden

03/30/2020 at 04:23AM

31
#12 - せいほう / @FICSQF

04/26/2020 at 06:16AM

31
#13 - Jonáš Šerých / @serycjon

05/15/2020 at 09:49PM

31
#14 - A A A / @37fatos

02/02/2021 at 06:13PM

31
#15 - Jung Yeon Park / @park_jungy

02/09/2021 at 02:21AM

31
#16 - hepebexè / @hepebexe

02/16/2021 at 07:13PM

31
#17 - Roman Privalov / @RomanPrivalov

09/15/2021 at 07:53AM

31
#18 - russellzhaomao / @russellzhaomao

05/25/2022 at 12:04AM

31
#19 - Alex / @AlexanderHeatl2

07/06/2022 at 09:18PM

31
#20 - moh ayaya / @AyayaMoh

08/29/2023 at 05:51PM

31
#21 - Luoyb / @Luoyb

10/27/2023 at 03:30AM

31
#22 - Peppa Pig / @PeppaPigSg

05/18/2024 at 04:03AM

31
#23 - Aly Thobani / @alythobani

05/29/2024 at 11:31PM

31
#24 - nickGPT / @nickandbro

08/24/2024 at 01:44PM

32
#25 - "Smylers" / @Smylers2

02/06/2020 at 11:27PM

32
#26 - Kyle X. Clark / @KyXr_Clark

02/07/2020 at 03:28AM

32
#27 - Falafel Palapel / @falafelpalapel

02/15/2020 at 10:17AM

32
#28 - KingYames / @JamesZeHunter

02/17/2020 at 04:44AM

32
#29 - floyd / @floyd10086

03/12/2020 at 04:58AM

32
#30 - Toby Hawkins / @Toby_Hawkins

03/16/2020 at 10:16PM