VScode snippet 变量

TM_SELECTED_TEXT The currently selected text or the empty string
TM_CURRENT_LINE The contents of the current line
TM_CURRENT_WORD The contents of the word under cursor or the empty string
TM_LINE_INDEX The zero-index based line number
TM_LINE_NUMBER The one-index based line number
TM_FILENAME The filename of the current document
TM_FILENAME_BASE The filename of the current document without its extensions
TM_DIRECTORY The directory of the current document
TM_FILEPATH The full file path of the current document
CLIPBOARD The contents of your clipboard
WORKSPACE_NAME The name of the opened workspace or folder

CURRENT_YEAR The current year
CURRENT_YEAR_SHORT The current year’s last two digits
CURRENT_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
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 format
CURRENT_MINUTE The current minute
CURRENT_SECOND The current second

####-----For inserting line or block comments, honoring the current language:----####

BLOCK_COMMENT_START Example output: in PHP /* or in HTML <!–
BLOCK_COMMENT_END Example output: in PHP */ or in HTML -->
LINE_COMMENT Example output: in PHP // or in HTML <!-- -->
----------------------------------------------------------------------------------------------
注:这些都是变量名,不是宏,在实际使用的时要加上 $ 符

TM_LINE_INDEX:行号(从零开始);

TM_LINE_NUMBER:行号(从一开始);

TM_FILENAME:当前文档的文件名;

TM_FILENAME_BASE:当前文档的文件名(不含后缀名);

TM_DIRECTORY:当前文档所在目录;

TM_FILEPATH:当前文档的完整文件路径;

CLIPBOARD:当前剪贴板中内容。

CURRENT_YEAR: 当前年份;

CURRENT_YEAR_SHORT: 当前年份的后两位;

CURRENT_MONTH: 格式化为两位数字的当前月份,如 02CURRENT_MONTH_NAME: 当前月份的全称,如 July;

CURRENT_MONTH_NAME_SHORT: 当前月份的简称,如 Jul;

CURRENT_DATE: 当天月份第几天;

CURRENT_DAY_NAME: 当天周几,如 Monday;

CURRENT_DAY_NAME_SHORT: 当天周几的简称,如 Mon;

CURRENT_HOUR: 当前小时(24 小时制);

CURRENT_MINUTE: 当前分钟;

CURRENT_SECOND: 当前秒数。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值