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

Updated plugins

This commit is contained in:
amix
2017-02-11 14:01:38 +01:00
parent a6de243fca
commit fe46dfbbe6
141 changed files with 2790 additions and 1630 deletions

View File

@ -5,22 +5,22 @@
priority -50
snippet let "let variable declaration" b
let ${1:name}${2:: ${3:type}} = ${4};
let ${1:name}${2:: ${3:type}} = $4;
endsnippet
snippet letm "let mut variable declaration" b
let mut ${1:name}${2:: ${3:type}} = ${4};
let mut ${1:name}${2:: ${3:type}} = $4;
endsnippet
snippet fn "A function, optionally with arguments and return type."
fn ${1:function_name}(${2})${3/..*/ -> /}${3} {
${VISUAL}${0}
fn ${1:function_name}($2)${3/..*/ -> /}$3 {
${VISUAL}$0
}
endsnippet
snippet pfn "A public function, optionally with arguments and return type."
pub fn ${1:function_name}(${2})${3/..*/ -> /}${3} {
${VISUAL}${0}
pub fn ${1:function_name}($2)${3/..*/ -> /}$3 {
${VISUAL}$0
}
endsnippet
@ -29,44 +29,44 @@ ${1:a}: ${2:T}${3:, arg}
endsnippet
snippet || "Closure, anonymous function (inline)" i
${1:move }|${2}| { $3 }
${1:move }|$2| { $3 }
endsnippet
snippet |} "Closure, anonymous function (block)" i
${1:move }|${2}| {
${1:move }|$2| {
$3
}
endsnippet
snippet pri "print!(..)" b
print!("${1}"${2/..*/, /}${2});
print!("$1"${2/..*/, /}$2);
endsnippet
snippet pln "println!(..)" b
println!("${1}"${2/..*/, /}${2});
println!("$1"${2/..*/, /}$2);
endsnippet
snippet fmt "format!(..)"
format!("${1}"${2/..*/, /}${2});
format!("$1"${2/..*/, /}$2);
endsnippet
snippet macro "macro_rules!" b
macro_rules! ${1:name} {
(${2:matcher}) => (
${3}
$3
)
}
endsnippet
snippet mod "A module" b
mod ${1:`!p snip.rv = snip.basename.lower() or "name"`} {
${VISUAL}${0}
${VISUAL}$0
}
endsnippet
snippet for "for .. in .." b
for ${1:i} in ${2} {
${VISUAL}${0}
for ${1:i} in $2 {
${VISUAL}$0
}
endsnippet
@ -76,19 +76,19 @@ endsnippet
snippet st "Struct" b
struct ${1:`!p snip.rv = snip.basename.title() or "Name"`} {
${VISUAL}${0}
${VISUAL}$0
}
endsnippet
# TODO: fancy dynamic field mirroring like Python slotclass
snippet stn "Struct with new constructor." b
pub struct ${1:`!p snip.rv = snip.basename.title() or "Name"`} {
fd${0}
fd$0
}
impl $1 {
pub fn new(${2}) -> $1 {
$1 { ${3} }
pub fn new($2) -> $1 {
$1 { $3 }
}
}
endsnippet
@ -99,7 +99,7 @@ endsnippet
snippet impl "Struct/Trait implementation" b
impl ${1:Type/Trait}${2: for ${3:Type}} {
${0}
$0
}
endsnippet