ultisnip scripts, autopairs and spellcheck
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user