description: make a snippet with current datetime
open snippet file to edit
File -> preference –> user snippets
edit snippet like following
${CURRENT_DATE}/${CURRENT_MONTH}/${CURRENT_YEAR} ${CURRENT_HOUR}:${CURRENT_MINUTE}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24{
"post": {
"prefix": ".post",
"body": [
"---\r",
"title: ${1}\r",
"date: ${CURRENT_DATE}/${CURRENT_MONTH}/${CURRENT_YEAR} ${CURRENT_HOUR}:${CURRENT_MINUTE}\r",
"tags: \r",
"keywords:\r",
"categories: \r",
"---\r",
"description:\r",
"\r",
"\r",
"\r",
"\r",
"---------------------------------------------\r",
"more on [search4fan.github.io](https://search4fan.github.io/)\r",
"\r",
""
],
"description": "post template"
}
}
other variables
TM_SELECTED_TEXT
The currently selected text or the empty stringTM_LINE_NUMBER
The one-index based line numberTM_FILENAME
The filename of the current documentTM_FILENAME_BASE
The filename of the current document without its extensionsTM_LINE_INDEX
The zero-index based line numberTM_DIRECTORY
The directory of the current documentTM_FILEPATH
The full file path of the current documentCLIPBOARD
The contents of your clipboardTM_CURRENT_LINE
The contents of the current lineTM_CURRENT_WORD
The contents of the word under cursor or the empty string
CURRENT_DAY_NAME
The name of day (example ‘Monday’)CURRENT_DAY_NAME_SHORT
The short name of the day (example ‘Mon’)CURRENT_HOUR
The current hour in 24-hour clock formatCURRENT_MINUTE
The current minuteCURRENT_SECOND
The current second
CURRENT_YEAR
The current yearCURRENT_YEAR_SHORT
The current year’s last two digitsCURRENT_MONTH
The month as two digits (example ‘02’)CURRENT_MONTH_NAME
The full name of the month (example ‘July’)CURRENT_MONTH_NAME_SHORT
The short name of the month (example ‘Jul’)CURRENT_DATE
The day of the month
more on search4fan.github.io