nvim: add "datestamp" snippet
This commit is contained in:
parent
85ef7dd310
commit
643602f4ab
@ -3,7 +3,13 @@ snippet shrug "shrug emoticon"
|
|||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet timestamp "unix time for today"
|
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
|
endsnippet
|
||||||
|
|
||||||
snippet today "normal formatted date for today" i
|
snippet today "normal formatted date for today" i
|
||||||
|
Loading…
Reference in New Issue
Block a user