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):
32
#31 - Robberechts Arne / @ArneRobberechts

03/22/2020 at 10:20PM

32
#32 - Quark / @PuzzleQuark

03/23/2020 at 09:42PM

32
#33 - Ryan Nevius / @ryannevius

03/24/2020 at 08:13PM

32
#34 - 廖彥智 / @JeffYenchih

04/15/2020 at 07:36AM

32
#35 - Oleg / @colega

04/25/2020 at 07:30PM

32
#36 - Moatvald / @moatvald

05/22/2020 at 12:27PM

32
#37 - :wq / @write_quit_22

05/21/2021 at 07:13AM

32
#38 - pikjes / @pikjes2

07/15/2021 at 12:41PM

32
#39 - naka / @nak38223985244

12/14/2023 at 11:26AM

33
#40 - Emil / @emilklindt

02/07/2020 at 07:06AM

33
#41 - garry quested / @GQuested

02/07/2020 at 09:53AM

33
#42 - vimgolf_tmp_2 / @2Vimgolf

02/16/2020 at 05:18PM

33
#43 - Valdimar / @genkobar

02/26/2020 at 10:37PM

33
#44 - Jason / @roosjason

05/10/2020 at 01:44AM

33
#45 - Youngchan Lee / @edwardycl

05/27/2021 at 07:55AM

33
#46 - ever0de / @ever0de

05/27/2021 at 08:08AM

33
#47 - James / @Dronak

10/12/2023 at 07:31PM

34
#48 - xiote / @xiote2

02/06/2020 at 10:57PM

34
#49 - Ollin Boer Bohan / @madebyollin

02/06/2020 at 11:27PM

34
#50 - Walker Boh / @walker_boh

02/07/2020 at 08:46AM

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

02/29/2020 at 04:59PM

34
#52 - Aioriya / @AioriyaDonk

05/06/2020 at 03:43AM

34
#53 - grsh / @girish_i_am

05/28/2021 at 05:57PM

35
#54 - みむら / @rnirnu

02/23/2020 at 08:27AM

35
#55 - Victor Chen / @VictorC36685615

03/27/2020 at 09:30PM

35
#56 - RockerZZY / @rocker_zzy

06/08/2020 at 01:02PM

35
#57 - RosaTryp / @RosaTryp

03/13/2023 at 07:17PM

36
#58 - xiaoao1024 / @xiaoao1024

05/11/2024 at 08:43AM

38
#59 - Renns / @Renns95250521

02/08/2020 at 10:01AM

39
#60 - Jonathan Skeate / @jskeate

02/09/2020 at 08:05PM