nvim/UltiSnips/rust.snippets

38 lines
450 B
Plaintext

snippet fn "function declaration" i
// $3 $1
// ${4:Description}
fn $1($2) `!p
if t[3] == "":
snip.rv = ""
else:
snip.rv = " -> "` $3 {
$5
}
$0
endsnippet
snippet struct "struct declaration"
// $1
// ${2:Description}
struct ${1:Name} {
$3
}
$0
endsnippet
snippet impl "implement struct"
// Implementation of $1
// ${2:Desciption}
impl ${1:struct} {
$3
}
$0
endsnippet
snippet for "for-loop"
for ${1:i} in ${2:$3..$4} {
$5
}$0
endsnippet