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

Updated plugins

This commit is contained in:
Amir
2021-10-11 11:30:43 +02:00
parent 83980d8f24
commit 92c794cc2b
100 changed files with 3555 additions and 1631 deletions

View File

@ -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

View File

@ -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)
}

View File

@ -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}) {

View File

@ -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}:

View File

@ -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