New themes, new snippets, change c-x to c-w

This commit is contained in:
2023-10-28 21:59:56 +02:00
parent 34ccdabaeb
commit 5f91641217
11 changed files with 199 additions and 5 deletions

112
UltiSnips/bib.snippets Normal file
View File

@@ -0,0 +1,112 @@
snippet book "Add book reference" b
@book{${1:ref_name},
author = {${2:Autor}},
year = {${3:2023}},
title = {${4:Buchtitel}},`!p
if t[5] != "":
snip.rv = "\n\tedition\t= {"
else:
snip.rv = ""`${5:Auflage}`!p
if t[5] != "":
snip.rv = "},"
else:
snip.rv = ""`
publisher = {${6:Verlag}}
}
$0
endsnippet
snippet article "Add article reference" b
@article{${1:ref_name},
title={${2:Titel}},
author={${3:Autor}},
journal={${4:Journal}},`!p
if t[5] != "":
snip.rv = "\n\tvolume\t= {"
else:
snip.rv = ""`${5:Band/Ausgabe}`!p
if t[5] != "":
snip.rv = "},"
else:
snip.rv = ""``!p
if t[6] != "":
snip.rv = "\n\tnumber\t= {"
else:
snip.rv = ""`${6:Nummer}`!p
if t[6] != "":
snip.rv = "},"
else:
snip.rv = ""``!p
if t[7] != "":
snip.rv = "\n\tpages\t= {"
else:
snip.rv = ""`${7:von--bis}`!p
if t[7] != "":
snip.rv = "},"
else:
snip.rv = ""`
year={${8:2023}},
publisher={${9:Verlag}}
}
$0
endsnippet
snippet inproceedings "Conference proceeding articles" b
@inproceedings{${1:ref_name},
author = {${2:Autor}},
title = {${3:Vortragstitel}},
booktitle = {${4:Buchtitel}},
year = {${5:2023}},`!p
if t[6] != "":
snip.rv = "\n\tpages\t= {"
else:
snip.rv = ""`${6:von--bis}`!p
if t[6] != "":
snip.rv = "},"
else:
snip.rv = ""`
}
$0
endsnippet
snippet inbook "Chapter of a book" b
@inbook{${1:ref_name},
title={${2:Titel}},`!p
if t[3] != "":
snip.rv = "\n\tedition\t= {"
else:
snip.rv = ""`${3:Ausgabe}`!p
if t[3] != "":
snip.rv = "},"
else:
snip.rv = ""`
author={${4:Autor}},
year={${5:2023}},
publisher={${6:Verlag}},
chapter={${7:Kapitel}}
}
$0
endsnippet
snippet web "Webpage" b
@misc{${1:ref_name},
author = {${2:Autor}},
title = {${3:Titel}},
year = {${4:2023}},
note = {Abgerufen am: ${5:`date`}},
url = {${6:URL}}
}
$0
endsnippet
snippet video "Video (Netz)" b
@misc{${1:ref_name},
author = {${2:Autor}},
title = {${3:Titel}},
year = {${4:2023}},
note = {${5:start}--${6:ende}},
url = {${7:URL}},
urldate = {${8:`date`}}
}
$0
endsnippet

View File

@@ -100,7 +100,7 @@ snippet "(\w+) = malloc" "Automativ malloc error implementation" rA
`!p snip.rv = match.group(1)` = ($1*)malloc(sizeof(${1:int}) * $2);
if (!`!p snip.rv = match.group(1)`) {
/* Error */
perror("malloc error on memory allocation of: `!p snip.rv = match.group(1)`");
(void)printf("malloc error on memory allocation of: `!p snip.rv = match.group(1)`!\n");
exit(EXIT_FAILURE);
}
$0

View File

@@ -8,7 +8,7 @@ def complete(t, opts):
endglobal
snippet !! "Standard message" bA
$1`!p snip.rv=complete(t[1], ["BUG", "INFO", "UPDATE", "FEATURE", "ADD"])`: $2`!p snip.rv=complete(t[2], ["OPEN", "CLOSE", "FIX", "WARNING", "ERROR", "ADD", "REMOVED", "TODO"])` `!p
$1`!p snip.rv=complete(t[1], ["BUG", "INFO", "UPDATE", "FEATURE", "ADD"])`: $2`!p snip.rv=complete(t[2], ["OPEN", "CLOSE", "FIX", "WARNING", "ERROR", "ADD", "REMOVED", "TODO", "NEW"])` `!p
if t[3] == "":
snip.rv = ""
else:

View File

@@ -1,6 +1,6 @@
snippet snip "Create new snippet"
snippet ${1:Name} "${2:Description}" ${3:Options}
$4
`echo endsnippet`
`!p snip.rv = "endsnippet"`
$0
endsnippet

View File

@@ -560,3 +560,20 @@ endsnippet
snippet ß "Backslash" A
\\
endsnippet
snippet bibbook "Add a new book/journal/paper reference" b
\\bibitem{${1:Reference_name}}
${2:Author}. (${3:2023}) \`${4:Title}'. ${5:Extension} `!p
if t[6] == "":
snip.rv = ""
elif "-" in t[6]:
snip.rv = "Seiten "
else:
snip.rv = "Seite"
`$6`!p
if t[6] == "":
snip.rv = ""
else:
snip.rv = "."`
$0
endsnippet