mirror of
https://github.com/amix/vimrc
synced 2024-12-22 01:43:06 +00:00
53 lines
1.1 KiB
Text
53 lines
1.1 KiB
Text
#######################################################################
|
|
# Rust Snippets #
|
|
#######################################################################
|
|
|
|
priority -50
|
|
|
|
snippet fn "fn name(?) -> ? {}"
|
|
fn ${1:function_name}($2)${3/..*/ -> /}$3 {
|
|
${VISUAL}$0
|
|
}
|
|
endsnippet
|
|
|
|
snippet pfn "pub fn name(?) -> ? {}"
|
|
pub fn ${1:function_name}($2)${3/..*/ -> /}$3 {
|
|
${VISUAL}$0
|
|
}
|
|
endsnippet
|
|
|
|
snippet afn "async fn name(?) -> ? {}"
|
|
async fn ${1:function_name}($2)${3/..*/ -> /}$3 {
|
|
${VISUAL}$0
|
|
}
|
|
endsnippet
|
|
|
|
snippet pafn "pub async fn name(?) -> ? {}"
|
|
pub async fn ${1:function_name}($2)${3/..*/ -> /}$3 {
|
|
${VISUAL}$0
|
|
}
|
|
endsnippet
|
|
|
|
snippet pri "print!(..)" b
|
|
print!("$1"${2/..*/, /}$2);
|
|
endsnippet
|
|
|
|
snippet pln "println!(..)" b
|
|
println!("$1"${2/..*/, /}$2);
|
|
endsnippet
|
|
|
|
snippet fmt "format!(..)"
|
|
format!("$1"${2/..*/, /}$2);
|
|
endsnippet
|
|
|
|
snippet .it ".iter()" i
|
|
.iter()$0
|
|
endsnippet
|
|
|
|
snippet impl "Struct/Trait implementation" b
|
|
impl$4 ${1:Type/Trait}${2: for ${3:Type}}${4:<${5:T}>} {
|
|
${0}
|
|
}
|
|
endsnippet
|
|
|
|
# vim:ft=snippets:
|