mirror of
https://github.com/amix/vimrc
synced 2025-06-17 02:15:01 +08:00
Updated plugins
This commit is contained in:
@ -334,6 +334,33 @@ snippet getopt
|
||||
${0}
|
||||
}
|
||||
}
|
||||
|
||||
## Assertions
|
||||
snippet asr
|
||||
assert(${1:condition});
|
||||
|
||||
snippet anl
|
||||
assert(${1:ptr} != NULL);
|
||||
|
||||
## Dynamic Allocation
|
||||
snippet mlc
|
||||
${1:ptr} = (${2:type}*) malloc(sizeof($2));
|
||||
|
||||
snippet clc
|
||||
${1:ptr} = (${2:type}*) calloc(${3:size}, sizeof($2));
|
||||
|
||||
snippet rlc
|
||||
${1:ptr} = realloc($1, ${2:size} * sizeof(${3:type}));
|
||||
|
||||
snippet mlcd
|
||||
${1:type} ${2:ptr} = ($1*) malloc(sizeof($1));
|
||||
|
||||
snippet clcd
|
||||
${1:type} ${2:ptr} = ($1*) calloc(${3:size}, sizeof($1));
|
||||
|
||||
snippet fre
|
||||
free(${1:ptr});
|
||||
|
||||
##
|
||||
# TODO section
|
||||
snippet todo
|
||||
|
@ -274,7 +274,7 @@ snippet ja "Marshalable json alias"
|
||||
}
|
||||
|
||||
|
||||
snippet errwr "Error handling with errors.Wrap"
|
||||
snippet errwr "Error handling with fmt.Errorf"
|
||||
if ${1}err != nil {
|
||||
return errors.Wrap(err, "${2}")
|
||||
return fmt.Errorf("${2} %w", err)
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ snippet ex
|
||||
module.exports = ${1};
|
||||
# require
|
||||
snippet re
|
||||
${1:const} ${2} = require('${3:module_name}');
|
||||
const ${1} = require('${2:module_name}');
|
||||
# EventEmitter
|
||||
snippet on
|
||||
on('${1:event_name}', function(${2:stream}) {
|
||||
|
@ -85,16 +85,15 @@ snippet adefm
|
||||
|
||||
# New Property
|
||||
snippet property
|
||||
def ${1:foo}():
|
||||
doc = "${2:The $1 property.}"
|
||||
def fget(self):
|
||||
${3:return self._$1}
|
||||
def fset(self, value):
|
||||
${4:self._$1 = value}
|
||||
def fdel(self):
|
||||
${0:del self._$1}
|
||||
return locals()
|
||||
$1 = property(**$1())
|
||||
@property
|
||||
def ${1:foo}(self) -> ${2:type}:
|
||||
"""${3:doc}"""
|
||||
return self._${1:foo}
|
||||
|
||||
@${1:foo}.setter
|
||||
def ${1:foo}(self, value: ${2:type}):
|
||||
self._${1:foo} = value
|
||||
|
||||
# Ifs
|
||||
snippet if
|
||||
if ${1:condition}:
|
||||
|
@ -380,11 +380,11 @@ snippet lim limit
|
||||
|
||||
# Partial derivative
|
||||
snippet pdv partial derivation
|
||||
\\frac{\\partial {$1}}{\partial {$2}} {$0}
|
||||
\\frac{\\partial {$1}}{\\partial {$2}} {$0}
|
||||
|
||||
# Second order partial derivative
|
||||
snippet ppdv second partial derivation
|
||||
\\frac{\partial^2 {$1}}{\partial {$2} \partial {$3}} {$0}
|
||||
\\frac{\\partial^2 {$1}}{\\partial {$2} \\partial {$3}} {$0}
|
||||
|
||||
# Ordinary derivative
|
||||
snippet dv derivative
|
||||
@ -416,7 +416,7 @@ snippet . dot product
|
||||
|
||||
# Integral
|
||||
snippet int integral
|
||||
\\int_{{$1}}^{{$2}} {$3} \: d{$4} {$5}
|
||||
\\int_{{$1}}^{{$2}} {$3} \\: d{$4} {$0}
|
||||
|
||||
# Right arrow
|
||||
snippet ra rightarrow
|
||||
|
Reference in New Issue
Block a user