nvim: add "datestamp" snippet

This commit is contained in:
dogeystamp 2023-02-01 13:22:52 -05:00
parent 85ef7dd310
commit 643602f4ab
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -3,7 +3,13 @@ snippet shrug "shrug emoticon"
endsnippet
snippet timestamp "unix time for today"
`date -d "$(date +"%Y-%m-%d 15:45")" +%s`
`date -d "$(date +"%Y-%m-%d")" +%s`
endsnippet
snippet "datestamp (.*)" "unix time (YYYY-MM-DD)" r
`!p
from time import mktime, strptime
snip.rv = int(mktime(strptime(match.group(1), "%Y-%m-%d")))
`
endsnippet
snippet today "normal formatted date for today" i