added Snippets

This commit is contained in:
Yannick Reiß 2023-08-11 08:56:49 +02:00
parent cb97c6b2ac
commit 72bdf68ee5
No known key found for this signature in database
GPG Key ID: 5A3AF456F0A0338C
1 changed files with 27 additions and 0 deletions

View File

@ -31,3 +31,30 @@ snippet - "Itemized List" b
t[1] = t[1].replace(" \n", f"\n-")`
$0
endsnippet
global !p
def complete(t, opts):
if t:
opts = [ m[len(t):] for m in opts if m.startswith(t)]
if len(opts) == 1:
return opts[0]
else:
return f"({'|'.join(opts)})"
endglobal
snippet mgl "DLRG neues Mitglied" b
${1:Num}|${2:Eintrittsdatum}`!p
if t[2] != "Eintrittsdatum" and len(t[2]) == 8:
if len(t[2]) > 2:
t[2] = f"{t[2][0:2]}.{t[2][2:]}"
if len(t[2]) > 4:
t[2] = f"{t[2][:5]}.{t[2][5:]}"
`|${3:Geburtsdatum}`!p
if t[3] != "Eintrittsdatum" and len(t[3]) == 8:
if len(t[3]) > 2:
t[3] = f"{t[3][0:2]}.{t[3][2:]}"
if len(t[3]) > 4:
t[3] = f"{t[3][:5]}.{t[3][5:]}"
`|${4:PLZ}|${5}`!p snip.rv= complete(t[5], ['Offenbach', 'Hanau', 'Mühlheim', 'Frankfurt'])`|${6:Adresse}|${7:Nachname}`!p t[7] = t[7].upper()`, ${8:Vorname}
endsnippet