mirror of
https://github.com/amix/vimrc
synced 2025-07-13 06:35:01 +08:00
😼 Update plugins
This commit is contained in:
@ -112,12 +112,12 @@ snippet img "Image"
|
||||
endsnippet
|
||||
|
||||
snippet ilc "Inline Code" i
|
||||
\`$1\`$0
|
||||
\`${1:${VISUAL}}\`$0
|
||||
endsnippet
|
||||
|
||||
snippet cbl "Codeblock" b
|
||||
\`\`\`
|
||||
$1
|
||||
\`\`\`$1
|
||||
${2:${VISUAL}}
|
||||
\`\`\`
|
||||
$0
|
||||
endsnippet
|
||||
|
@ -73,7 +73,23 @@ class Arg(object):
|
||||
|
||||
|
||||
def get_args(arglist):
|
||||
args = [Arg(arg) for arg in arglist.split(',') if arg]
|
||||
args = []
|
||||
n = len(arglist)
|
||||
i = 0
|
||||
while i < n:
|
||||
l_bracket = 0
|
||||
start = i
|
||||
while i < n and (l_bracket > 0 or arglist[i] != ','):
|
||||
if arglist[i] == '[':
|
||||
l_bracket += 1
|
||||
elif arglist[i] == ']' and l_bracket > 0:
|
||||
l_bracket -= 1
|
||||
i += 1
|
||||
arg = arglist[start:i]
|
||||
if arg:
|
||||
args.append(Arg(arg))
|
||||
i += 1
|
||||
|
||||
args = [arg for arg in args if arg.name != 'self']
|
||||
|
||||
return args
|
||||
|
@ -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
|
||||
|
@ -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}) {
|
||||
|
@ -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