1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated vim plugins

This commit is contained in:
amix
2017-07-06 14:57:35 +02:00
parent 48a2c325c3
commit 391f8b5c06
82 changed files with 2016 additions and 2757 deletions

View File

@ -226,3 +226,29 @@ snippet bench benchmark function
}
}
${0}
# composite literals
snippet cl
type ${1:name} struct {
${2:attrName} ${3:attrType}
}
# if key in a map
snippet om
if ${1:value}, ok := ${2:map}[${3:key}]; ok == true {
${4:/* code */}
}
# Grouped globals with anonymous struct
snippet gg
var ${1:var} = struct{
${2:name} ${3:type}
}{
$2: ${4:value},
}
# Marshalable json alias
snippet ja
type ${1:parentType}Alias $1
func (p *$1) MarshalJSON() ([]byte, error) {
return json.Marshal(&struct{ *$1Alias }{(*$1Alias)(p)})
}