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 5957c3356f7e17045b00002c

Add Go XML to structure tags

The Go programming language can directly map XML to structure fields. Add the correct XML tag after each field.

Start file
package main

// FooXML mapping from XML to struct
type FooXML struct {
	Field1 string
	Field2 string
	Field3 string
}
End file
package main

// FooXML mapping from XML to struct
type FooXML struct {
	Field1 string `xml:"field1"`
	Field2 string `xml:"field2"`
	Field3 string `xml:"field3"`
}

View Diff

5,7c5,7
< 	Field1 string
< 	Field2 string
< 	Field3 string
---
> 	Field1 string `xml:"field1"`
> 	Field2 string `xml:"field2"`
> 	Field3 string `xml:"field3"`

Solutions by @simmons_dan:

Unlock 8 remaining solutions by signing in and submitting your own entry
Created by: @KaizenSoze70

69 active golfers, 170 entries

Solutions by @simmons_dan:
25
#22 - Dan Simmons / @simmons_dan

07/13/2017 at 02:53PM

28
#>33 - Dan Simmons / @simmons_dan

07/13/2017 at 02:50PM

29
#>37 - Dan Simmons / @simmons_dan

07/13/2017 at 02:47PM

30
#>43 - Dan Simmons / @simmons_dan

07/13/2017 at 02:47PM

31
#>51 - Dan Simmons / @simmons_dan

07/13/2017 at 02:40PM

32
#>57 - Dan Simmons / @simmons_dan

07/13/2017 at 02:39PM

34
#>64 - Dan Simmons / @simmons_dan

07/13/2017 at 02:38PM

35
#>64 - Dan Simmons / @simmons_dan

07/13/2017 at 02:37PM