mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -185,7 +185,7 @@ ${1:FIELDNAME} = models.DateTimeField($2)
|
||||
endsnippet
|
||||
|
||||
snippet mdecimal "DecimalField" b
|
||||
${1:FIELDNAME} = models.DateTimeField($2)
|
||||
${1:FIELDNAME} = models.DecimalField(max_digits=${2:10}, decimal_places=${3:2})
|
||||
endsnippet
|
||||
|
||||
snippet memail "EmailField" b
|
||||
|
@ -45,25 +45,6 @@ type ${1:Interface} interface {
|
||||
}
|
||||
endsnippet
|
||||
|
||||
# statements
|
||||
snippet for "For loop" b
|
||||
for ${1:condition}${1/(.+)/ /}{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet fori "Integer for loop" b
|
||||
for ${1:i} := 0; $1 < ${2:N}; $1++ {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet forr "For range loop" b
|
||||
for ${2:name} := range ${1:collection} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet if "If statement" b
|
||||
if ${1:condition}${1/(.+)/ /}{
|
||||
${0:${VISUAL}}
|
||||
@ -76,22 +57,6 @@ case${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet select "Select statement" b
|
||||
select {
|
||||
case${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet case "Case clause" b
|
||||
case ${1:condition}:
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
snippet default "Default clause" b
|
||||
default:
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
# functions
|
||||
snippet /^main/ "Main function" r
|
||||
func main() {
|
||||
|
@ -58,6 +58,12 @@ ${1:var }${2:function_name} = function $2(${3}) {
|
||||
};
|
||||
endsnippet
|
||||
|
||||
snippet af "Anonymous Function" i
|
||||
function($1) {
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet iife "Immediately-Invoked Function Expression (iife)"
|
||||
(function(${1:window}) {
|
||||
${VISUAL}$0
|
||||
|
@ -51,11 +51,11 @@ format!("${1}"${2/..*/, /}${2});
|
||||
endsnippet
|
||||
|
||||
snippet macro "macro_rules!" b
|
||||
macro_rules! ${1:name} (
|
||||
macro_rules! ${1:name} {
|
||||
(${2:matcher}) => (
|
||||
${3}
|
||||
)
|
||||
)
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet mod "A module" b
|
||||
@ -88,7 +88,7 @@ pub struct ${1:`!p snip.rv = snip.basename.title() or "Name"`} {
|
||||
|
||||
impl $1 {
|
||||
pub fn new(${2}) -> $1 {
|
||||
$1 { ${3} };
|
||||
$1 { ${3} }
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
Reference in New Issue
Block a user