1
0
Fork 0
mirror of synced 2024-11-25 10:15:35 -05:00
ultimate-vim/sources_non_forked/vim-snippets/UltiSnips/rust.snippets

54 lines
1.1 KiB
Text
Raw Normal View History

2014-04-18 08:58:02 -04:00
#######################################################################
# Rust Snippets #
#######################################################################
2014-07-02 07:18:18 -04:00
priority -50
2020-04-25 21:56:16 -04:00
snippet fn "fn name(?) -> ? {}"
2018-12-17 06:28:27 -05:00
fn ${1:function_name}($2)${3/..*/ -> /}$3 {
${VISUAL}$0
}
endsnippet
2015-12-08 08:20:04 -05:00
2018-12-17 06:28:27 -05:00
snippet pfn "pub fn name(?) -> ? {}"
pub fn ${1:function_name}($2)${3/..*/ -> /}$3 {
${VISUAL}$0
}
2015-03-14 16:02:10 -04:00
endsnippet
2020-05-10 10:24:38 -04:00
snippet afn "async fn name(?) -> ? {}"
2020-06-21 11:50:44 -04:00
async fn ${1:function_name}($2)${3/..*/ -> /}$3 {
2020-05-10 10:24:38 -04:00
${VISUAL}$0
}
endsnippet
snippet pafn "pub async fn name(?) -> ? {}"
2020-06-21 11:50:44 -04:00
pub async fn ${1:function_name}($2)${3/..*/ -> /}$3 {
2020-05-10 10:24:38 -04:00
${VISUAL}$0
}
endsnippet
2018-12-17 06:28:27 -05:00
snippet pri "print!(..)" b
print!("$1"${2/..*/, /}$2);
2015-03-14 16:02:10 -04:00
endsnippet
2018-12-17 06:28:27 -05:00
snippet pln "println!(..)" b
println!("$1"${2/..*/, /}$2);
2015-03-14 16:02:10 -04:00
endsnippet
2018-12-17 06:28:27 -05:00
snippet fmt "format!(..)"
format!("$1"${2/..*/, /}$2);
2014-07-02 07:18:18 -04:00
endsnippet
2014-04-18 08:58:02 -04:00
2019-01-08 05:11:54 -05:00
snippet .it ".iter()" i
2018-12-17 06:28:27 -05:00
.iter()$0
2015-03-14 16:02:10 -04:00
endsnippet
2020-06-21 11:50:44 -04:00
snippet impl "Struct/Trait implementation" b
2020-12-04 16:15:32 -05:00
impl$4 ${1:Type/Trait}${2: for ${3:Type}}${4:<${5:T}>} {
${0}
2020-06-21 11:50:44 -04:00
}
endsnippet
2014-04-18 08:58:02 -04:00
# vim:ft=snippets: