ultisnip scripts, autopairs and spellcheck

This commit is contained in:
hollorol
2024-07-30 22:59:49 +02:00
parent 2f5c1137ff
commit 1fa37d6e39
23 changed files with 355 additions and 1 deletions
+19
View File
@@ -0,0 +1,19 @@
snippet '^h([0-9]{1})$' "header creation" r
`!p
snip.rv='='*int(match.group(1))`$1`!p
snip.rv='='*int(match.group(1))`
$0
endsnippet
snippet '_t([0-9]+)([w,d]{1})$' "header creation" r
`!p
import datetime
shift_amount=int(match.group(1))
shift_unit=match.group(2)
if shift_unit == "d":
ret = (datetime.date.today()+datetime.timedelta(days=shift_amount)).strftime("%Y-%m-%d")
else:
ret = (datetime.date.today()+datetime.timedelta(weeks=shift_amount)).strftime("%Y-%m-%d")
snip.rv = f"({ret})"
`$0
endsnippet