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 41 remaining solutions by signing in and submitting your own entry
#42 Nick Lee / @TooManyNickLees - Score: 46 - 04/05/20 @ 19:02
jA {<Esc>:<50-53>3,6s/\(\S*$\)/`json:"\1"`<Esc>[201~<CR>o}<Esc><<ZZ

0 comments


Created by: @xiote2

42 active golfers, 112 entries

Leaderboard (lowest score wins):
34
#31 - xiote / @xiote2

02/06/2020 at 10:57PM

34
#32 - Ollin Boer Bohan / @madebyollin

02/06/2020 at 11:27PM

34
#33 - Walker Boh / @walker_boh

02/07/2020 at 08:46AM

34
#34 - Максим Селиверстов / @max_developer

02/29/2020 at 04:59PM

34
#35 - José / @AngelGaldamez

05/06/2020 at 03:43AM

35
#36 - みむら / @rnirnu

02/23/2020 at 08:27AM

35
#37 - Victor Chen / @VictorC36685615

03/27/2020 at 09:30PM

35
#38 - RockerZZY / @rocker_zzy

06/08/2020 at 01:02PM

38
#39 - Renns / @Renns95250521

02/08/2020 at 10:01AM

39
#40 - Jonathan Skeate / @jskeate

02/09/2020 at 08:05PM

39
#41 - mat / @GrisMat_

02/23/2020 at 11:07PM

46
#42 - Nick Lee / @TooManyNickLees

04/05/2020 at 07:02PM