Updated go snippets, added json snippets
This commit is contained in:
parent
45b1d09d53
commit
f8af2e2fa6
@ -34,19 +34,19 @@ endsnippet
|
||||
# statements
|
||||
snippet for "For loop" !b
|
||||
for ${1:condition}${1/(.+)/ /}{
|
||||
${0:// body}
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet forr "For range loop" !b
|
||||
for ${2:name} := range ${1:collection} {
|
||||
${0:// body}
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet if "If statement" !b
|
||||
if ${1:condition}${1/(.+)/ /}{
|
||||
${0:// body}
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
@ -58,30 +58,30 @@ endsnippet
|
||||
|
||||
snippet case "Case clause" !b
|
||||
case ${1:condition}:
|
||||
${0://body}
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
snippet default "Default clause" !b
|
||||
default:
|
||||
${0://body}
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
# functions
|
||||
snippet /^main/ "Main function" r
|
||||
func main() {
|
||||
${0:// body}
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /^meth/ "Method" r
|
||||
func (${1:receiver} ${2:type}) ${3:name}(${4:params})${5/(.+)/ /}${5:type} {
|
||||
${0:// body}
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /^func/ "Function" r
|
||||
snippet func "Function" b
|
||||
func ${1:name}(${2:params})${3/(.+)/ /}${3:type} {
|
||||
${0:// body}
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
19
UltiSnips/json.snippets
Normal file
19
UltiSnips/json.snippets
Normal file
@ -0,0 +1,19 @@
|
||||
snippet s "String" b
|
||||
"${1:key}": "${0:value}",
|
||||
endsnippet
|
||||
|
||||
snippet n "number" b
|
||||
"${1:key}": ${0:value},
|
||||
endsnippet
|
||||
|
||||
snippet a "Array" b
|
||||
[
|
||||
${VISUAL}$0
|
||||
],
|
||||
endsnippet
|
||||
snippet o "Object" b
|
||||
{
|
||||
${VISUAL}$0
|
||||
},
|
||||
endsnippet
|
||||
|
Loading…
x
Reference in New Issue
Block a user