With $name or ${name:default}, you can insert the value of a variable. When a variable isn’t set, its default or the empty string is inserted. When a variable is unknown (that is, its name isn’t defined) the name of the variable is inserted and it is transformed into a placeholder.
The following variables can be used:
TM_SELECTED_TEXTThe currently selected text or the empty stringTM_CURRENT_LINEThe contents of the current lineTM_CURRENT_WORDThe contents of the word under cursor or the empty stringTM_LINE_INDEXThe zero-index based line numberTM_LINE_NUMBERThe one-index based line numberTM_FILENAMEThe filename of the current documentTM_FILENAME_BASEThe filename of the current document without its extensionsTM_DIRECTORYThe directory of the current documentTM_FILEPATHThe full file path of the current documentRELATIVE_FILEPATHThe relative (to the opened workspace or folder) file path of the current documentCLIPBOARDThe contents of your clipboardWORKSPACE_NAMEThe name of the opened workspace or folderWORKSPACE_FOLDERThe path of the opened workspace or folderCURSOR_INDEXThe zero-index based cursor numberCURSOR_NUMBERThe one-index based cursor number
For inserting the current date and time:
CURRENT_YEARThe current yearCURRENT_YEAR_SHORTThe current year’s last two digitsCURRENT_MONTHThe month as two digits (example ’02‘)CURRENT_MONTH_NAMEThe full name of the month (example ‚July‘)CURRENT_MONTH_NAME_SHORTThe short name of the month (example ‚Jul‘)CURRENT_DATEThe day of the month as two digits (example ’08‘)CURRENT_DAY_NAMEThe name of day (example ‚Monday‘)CURRENT_DAY_NAME_SHORTThe short name of the day (example ‚Mon‘)CURRENT_HOURThe current hour in 24-hour clock formatCURRENT_MINUTEThe current minute as two digitsCURRENT_SECONDThe current second as two digitsCURRENT_SECONDS_UNIXThe number of seconds since the Unix epochCURRENT_TIMEZONE_OFFSETThe current UTC time zone offset as+HH:MMor-HH:MM(example-07:00).
For inserting random values:
RANDOM6 random Base-10 digitsRANDOM_HEX6 random Base-16 digitsUUIDA Version 4 UUID
For inserting line or block comments, honoring the current language:
BLOCK_COMMENT_STARTExample output: in PHP/*or in HTML<!--BLOCK_COMMENT_ENDExample output: in PHP*/or in HTML-->LINE_COMMENTExample output: in PHP//