Delete useless snippets, combining c and cpp snippets
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 25s

This commit is contained in:
2024-09-13 12:11:30 +02:00
parent 8026306999
commit f0b346271c
2 changed files with 21 additions and 319 deletions

View File

@@ -1,3 +1,6 @@
extends c
priority 100
snippet header "Header wrapper" b
#ifndef $1
#define $1
@@ -7,72 +10,6 @@ $0
#endif//$1
endsnippet
snippet for "For-loop head"
for (${1:int i} = ${2:0}; ${3:i}; ${4:--i}) {
$5
}
$0
endsnippet
snippet exfun "New Function with Documentation"
/**
* @name $2
* @return `!p t[1].replace("static ", "")`
* @brief ${4: Description}
*
`!p
params = t[3].split(", ")
rval = ""
for param in params:
if len(param.split(' ')) == 2:
rval += f" * @param {param}:\t{t[2]}_{param.split(' ')[1]}\n"
snip.rv = rval`
*/
${1:int} ${2:MyFunc} (${3:void}) {
`!p
if t[1] != "void":
snip.rv = f"{t[1].replace('static ', '')} rv = 0;"
else:
snip.rv = ""`
$5
`!p
if t[1].replace("static ", "") != "void":
snip.rv = f"return rv;"
else:
snip.rv = ""`
}
$0
endsnippet
snippet fun "Function template"
${1:int} ${2:Name} (${3:void}) {
$5
return ${6:`!p
if t[1].replace("static ", "") != "void":
snip.rv = f"0"
else:
snip.rv = ""`};
}
$0
endsnippet
snippet while "while loop head"
while (${1:true}) {
$2
}
$0
endsnippet
snippet ifelse "If-Clause"
if ($1) {
$2
} else {
$3
}
$0
endsnippet
snippet class "Add new class" bA
class $1 ${2::} `!p
if t[2] == ":":
@@ -150,47 +87,3 @@ for var in variables:
snip.rv = rv`
$0
endsnippet
snippet defstruct "define a new type with a struct" A
typedef struct $1 $1;
struct $1{
$2
};
endsnippet
snippet docomment "Meta Comment" A
/*
* Filename: `!p snip.rv = fn`
* Author: ${1:Yannick Reiss}
* Project: ${2:Project Name}
* Copyright: ${3:None}
* Description: ${4:Helpful description}
*/
$0
endsnippet
snippet let+ "Declare and initialize Variable" A
${1:int} ${2:Variable} = ${3:0}; /* ${4:Description} */
$0
endsnippet
snippet let- "Declare Variable" A
${1:int} ${2:Variable}; /* ${3:Description} */
$0
endsnippet
snippet pfun "prototype for function" bA
/**
* @name $2
* @return $1
* @brief ${4: Description}
* `!p
params = t[3].split(", ")
rval = ""
for param in params:
if len(param.split(' ')) >= 2:
rval += f"\n *\t@param {param}:\t{t[2]}_{param.split(' ')[1]}"
snip.rv = rval`
*/
${1:int} ${2:MyFunc} (${3:void});
endsnippet