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):
39
#61 - mat / @GrisMat_

02/23/2020 at 11:07PM

40
#62 - yaarrr / @v0lko

03/11/2021 at 11:28AM

40
#63 - reatter / @reatter

09/20/2024 at 08:27AM

46
#64 - Nick Lee / @TooManyNickLees

04/05/2020 at 07:02PM

47
#65 - Tuure / @tuure_p

03/24/2021 at 01:28AM