update
This commit is contained in:
@@ -13,7 +13,7 @@ if t[1] != "void":
|
||||
else:
|
||||
snip.rv = ""`
|
||||
$5
|
||||
`!p
|
||||
`!p
|
||||
if t[1] != "void":
|
||||
snip.rv = f"return rv;"
|
||||
else:
|
||||
@@ -60,7 +60,6 @@ snip.rv = rval`
|
||||
${1:int} ${2:MyFunc} (${3:void});
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet exfun "New Function with Documentation"
|
||||
/**
|
||||
* $2 -> $1
|
||||
@@ -82,7 +81,7 @@ if t[1] != "void":
|
||||
else:
|
||||
snip.rv = ""`
|
||||
$5
|
||||
`!p
|
||||
`!p
|
||||
if t[1] != "void":
|
||||
snip.rv = f"return rv;"
|
||||
else:
|
||||
@@ -120,7 +119,7 @@ if (-1 == `!p snip.rv = match.group(1)`) {
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet swapint "Swap two integer or numerical variables"
|
||||
snippet swap "Swap two integer or numerical variables"
|
||||
/* Swap Variables $1 and $2 */
|
||||
${1:Var1} = $1 + ${2:Var2};
|
||||
$2 = $1 - $2;
|
||||
@@ -141,10 +140,6 @@ def complete(t, opts):
|
||||
return '(' + '|'.join(opts) + ')'
|
||||
endglobal
|
||||
|
||||
snippet def "Completer for predefined Values"
|
||||
$1`!p snip.rv = complete(t[1], ['EXIT_SUCCESS', 'EXIT_FAILURE', 'INT_MAX', 'INT_MIN'])`
|
||||
endsnippet
|
||||
|
||||
snippet printf "Cast printf result to 'void' if heturn value is unneeded" bA
|
||||
(void)printf("$1"`!p
|
||||
if "%" in t[1]:
|
||||
@@ -291,7 +286,7 @@ if (`!p snip.rv = match.group(1)` < 0) {
|
||||
perror("fork error on creating new subprocess '`!p snip.rv = match.group(1)`'.");
|
||||
exit(EXIT_FAILURE);
|
||||
} else if (!`!p snip.rv = match.group(1)`) {
|
||||
/* fork runs from here */
|
||||
/* fork runs from here */
|
||||
${1:execve(proc, args, NULL)};
|
||||
}
|
||||
$0
|
||||
@@ -360,4 +355,3 @@ if ( fflush(stdout) ) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ if t[1] != "void":
|
||||
else:
|
||||
snip.rv = ""`
|
||||
$5
|
||||
`!p
|
||||
`!p
|
||||
if t[1] != "void":
|
||||
snip.rv = f"return rv;"
|
||||
else:
|
||||
@@ -124,7 +124,7 @@ for var in variables:
|
||||
snip.rv = rv`
|
||||
|
||||
private:
|
||||
$4
|
||||
$4
|
||||
|
||||
};
|
||||
`!p
|
||||
@@ -160,7 +160,7 @@ struct $1{
|
||||
endsnippet
|
||||
|
||||
snippet docomment "Meta Comment" A
|
||||
/*
|
||||
/*
|
||||
* Filename: `!p snip.rv = fn`
|
||||
* Author: ${1:Yannick Reiss}
|
||||
* Project: ${2:Project Name}
|
||||
@@ -179,3 +179,20 @@ snippet let- "Declare Variable" A
|
||||
${1:int} ${2:Variable}; /* ${3:Description} */
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet pfun "prototype for function" bA
|
||||
/**
|
||||
* $2 -> $1
|
||||
* @return $1
|
||||
* @brief Description:
|
||||
* ${4: Description}
|
||||
* @param Parameter:`!p
|
||||
params = t[3].split(",")
|
||||
rval = ""
|
||||
for param in params:
|
||||
if len(param.split(' ')) >= 2:
|
||||
rval += f"\n *\t\t{param}:\t{t[2]}_{param.split(' ')[1]}"
|
||||
snip.rv = rval`
|
||||
*/
|
||||
${1:int} ${2:MyFunc} (${3:void});
|
||||
endsnippet
|
||||
|
||||
@@ -545,3 +545,7 @@ snippet "@(\w)" "insert greek letter" irA
|
||||
\\`!p letters = {'a': 'alpha', 'A': 'Alpha', 'b': 'beta', 'B': 'Beta', 'g': 'gamma', 'G': 'Gamma', 'e': 'epsilon', 'E': 'Epsilon', 'o': 'omega', 'O': 'Omega', 'm': 'mu', 'M': 'Mu'}
|
||||
snip.rv = letters[ match.group(1) ]`
|
||||
endsnippet
|
||||
|
||||
snippet _- "Escape _ easier" iA
|
||||
\\_
|
||||
endsnippet
|
||||
|
||||
Reference in New Issue
Block a user