global !p
from datetime import datetime, timedelta

def relative_date(days):
    time_difference = timedelta(days=int(days))
    calculated_date = datetime.today() + time_difference

    return calculated_date  
endglobal

snippet "reldate (\d+)" "Prints out the relative date in ISO format." ri
`!p 
reldate = relative_date(match.group(1))
snip.rv = reldate.strftime("%F")
`
endsnippet

snippet today "Prints out today's date in ISO format" i
`!p
from datetime import datetime

snip.rv = datetime.today().strftime("%F")
`
endsnippet

snippet sign "Quick signature" i
${1:Sincerely,}
${2:Gabriel Arazas}
$0
endsnippet

snippet ie "Parenthetical material Latin 'id est' (ie)" iw
(i.e., $1) $0 
endsnippet

snippet eg "Parenthetical material Latin 'exempli gratia' (eg)" iw
(e.g., $1) $0
endsnippet

snippet em "Quick em dash" 
—
endsnippet

snippet em-mat "Em dash material" iw
— $1 — $0
endsnippet

snippet em-ie "'id est' surrounded with em dash" iw
— i.e., $1 — $0
endsnippet

snippet em-eg "'exempli gratia' surrounded with em dash" iw
— e.g., $1 — $0
endsnippet

# Quick word snippets 
# Each of these quick word snippets has a prefix of `qw-`
snippet qw-lx "LaTeX" iw
LaTeX
endsnippet

snippet qw-as "Asciidoctor" iw
Asciidoctor
endsnippet

