[TOC]
## For JSON.JSON(寫代碼片段專用)
>[info] json.json
```json
{
// ........START snippets variables.............
// Author: 877675862@qq.com
// Date: 2018/10/13
// Version: v1.0.0
// Note: 轉摘請聲明出處。
"Print to snippet": {
"prefix": "pr",
"body": [
"\"Print to ${towhat}\":{",
" \"prefix\":\"${pre}\",",
" \"body\":[",
" \"${body}\"",
" ],",
" \"description\":\"${des}\"",
"}"
],
"description": "For snippets"
},
"Print to TM-FILENAME": {
"prefix": "tm",
"body": [
"${foo:\"\\${TM_FILENAME\\}\"}"
],
"description": "For tm_filename:獲取當前文件名。"
},
"Print to TM-FILENAME-BASE": {
"prefix": "tm",
"body": [
"${foo:\"\\${TM_FILENAME_BASE\\}\"}"
],
"description": "For tm_filename_base:獲取當前文件類型。"
},
"Print to TM-DIRECTORY": {
"prefix": "tm",
"body": [
"${foo:\"\\${TM_DIRECTORY\\}\"}"
],
"description": "For tm_directory:獲取當前文件夾。"
},
"Print to TM-FILEPATH": {
"prefix": "tm",
"body": [
"${foo:\"\\${TM_FILENAPATH\\}\"}"
],
"description": "For tm_filepath:獲取當前文件路徑。"
},
"Print to TM-CLIPBOARD": {
"prefix": "tm",
"body": [
"${foo:\"\\${TM_CLIPBOARD\\}\"}"
],
"description": "For tm_clipboard:獲取剪貼板的內容。"
},
"Print to TM-SELECTED-TEXT": {
"prefix": "tm",
"body": [
"${foo:\"\\${TM_SELECTED-TEXT\\}\"}"
],
"description": "For tm_selected-text:獲取鼠標選取的字符或者空字符。"
},
"Print to TM-CURRENT-LINE": {
"prefix": "tm",
"body": [
"${foo:\"\\${TM_CURRENT_LINE\\}\"}"
],
"description": "For tm_current_line:當前行的內容。"
},
"Print to TM-CURRENT-WORD": {
"prefix": "tm",
"body": [
"${foo:\"\\${TM_CURRENT-WORD\\}\"}"
],
"description": "For tm_current_word:光標下的單詞內容或者空字符。"
},
"Print to TM-LINE-INDEX": {
"prefix": "tm",
"body": [
"${foo:\"\\${TM_LINE_INDEX\\}\"}"
],
"description": "For tm_line_index:基于0索引的行號。"
},
"Print to TM-LINE-NUMBER": {
"prefix": "tm",
"body": [
"${foo:\"\\${TM_LINE_NUMBER\\}\"}"
],
"description": "For tm_line_number:基于單索引的行號。"
},
// For TM date
"Print to CURRENT-YEAR": {
"prefix": "cur",
"body": [
"${foo:\"\\${CURRENT_YEAR\\}\"}"
],
"description": "獲取本年度。YYYY"
},
"Print to CURRENT-YEAR-SHORT": {
"prefix": "cur",
"body": [
"${foo:\"\\${CURRENT_YEAR_SHORT\\}\"}"
],
"description": "本年度的最后兩位數。"
},
"Print to CURRENT-MOTH": {
"prefix": "cur",
"body": [
"${foo:\"\\${CURRENT_MONTH\\}\"}"
],
"description": "本月 MM"
},
"Print to CURRENT-MOTH-NAME": {
"prefix": "cur",
"body": [
"${foo:\"\\${CURRENT_MONTH_NAME\\}\"}"
],
"description": "本月名稱 英文(example: July)",
},
"Print to CURRENT-MOTH-NAME-SHORT": {
"prefix": "cur",
"body": [
"${foo:\"\\${CURRENT_MONTH_NAME_SHORT\\}\"}"
],
"description": "本月 英文簡寫(example:Jul)"
},
"Print to CURRENT-DATE": {
"prefix": "cur",
"body": [
"${foo:\"\\${CURRENT_DATE\\}\"}"
],
"description": "今天 DD"
},
"Print to CURRENT-DATE-NAME": {
"prefix": "cur",
"body": [
"${foo:\"\\${CURRENT_DATE_NAME\\}\"}"
],
"description": "星期幾"
},
"Print to CURRENT-DATE-NAME-SHORT": {
"prefix": "cur",
"body": [
"${foo:\"\\${CURRENT_DATE_NAME_SHORT\\}\"}"
],
"description": "星期幾簡寫"
},
"Print to CURRENT-HOUR": {
"prefix": "cur",
"body": [
"${foo:\"\\${CURRENT_HOUR\\}\"}"
],
"description": "24小時制的當前小時。"
},
"Print to CURRENT-MINUTE": {
"prefix": "cur",
"body": [
"${foo:\"\\${CURRENT_MINUTE\\}\"}"
],
"description": "分鐘"
},
"Print to CURRENT-SECOND": {
"prefix": "cur",
"body": [
"${foo:\"\\${CURRENT_SECOND\\}\"}"
],
"description": "秒鐘"
},
// .......END snippets variables..........
}
```
## For JS file Header
>[info]javascript.json
```json
"Print to JSheader":{
"prefix": "jsh",
"body": [
"/**",
" * ",
" * @file ${TM_FILENAME}",
" * @author ${name} <${homepage}>",
" * @description ${des}",
" * Date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
" * Note: 轉摘請注明出處!!!",
" * ",
" */"
]
}
```