Snippet update

This commit is contained in:
Yannick Reiß 2023-09-29 07:48:11 +02:00
parent 3531864cbd
commit 17f25fc266
No known key found for this signature in database
GPG Key ID: 5A3AF456F0A0338C
2 changed files with 33 additions and 1 deletions

32
UltiSnips/csv.snippets Normal file
View File

@ -0,0 +1,32 @@
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 mv "Mitglied DLRG Neuaufnahme" bA
${1}`!p
snip.rv = complete(t[1], ["Herr", "Frau", "Ohne"])
`,${2:Vorname},${3:Nachname},${4:63165}`!p
snip.rv = complete(t[4], ["63165"])`,${5:Adresse},${6:Telefonnummer},${7:Email},${8:Geburtsdatum}`!p
if t[8] != "Geburtsdatum" and len(t[8]) == 8:
if len(t[8]) > 2:
t[8] = f"{t[8][0:2]}.{t[8][2:]}"
if len(t[8]) > 4:
t[8] = f"{t[8][:5]}.{t[8][5:]}"
`,${9:Eintrittsdatum}`!p
if t[9] != "Eintrittsdatum" and len(t[9]) == 8:
if len(t[9]) > 2:
t[9] = f"{t[9][0:2]}.{t[9][2:]}"
if len(t[9]) > 4:
t[9] = f"{t[9][:5]}.{t[9][5:]}"
`,DE${10:IBAN}`!p
if len(t[10]) >= 25:
t[10] = t[10].replace(' ', '')
`,${11:Kontoinhaber*in}
$0
endsnippet

View File

@ -50,7 +50,7 @@ if t[2] != "Eintrittsdatum" and len(t[2]) == 8:
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 t[3] != "Geburtsdatum" 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: