参考链接

The following variables can be used:

  • 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

For inserting the current date and time:

  • 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 <!-- -->

举例如下:

"c_header": {"prefix": "c_header","body": ["/**"," * Copyright © 2019 Silvester. All rights reserved."," * "," * @author: Silvester"," * @date: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE "," */","#include <stdio.h>","#include <stdlib.h>","#include <string.h>","","int main() {","    /****** your code ******/","    $0","    return 0;","}"]// "description": "Log output to console"}

输出效果:

/*** Copyright © 2019 Silvester. All rights reserved.* * @author: Silvester* @date: 2019-05-20 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>int main() {/****** your code ******/return 0;
}

VScode 的 code snippet 中可以使用的一些变量(时间,日期等)相关推荐

  1. python中可以用中文作为变量-在Python 3.x中可以使用中文作为变量名。

    [判断题]Python变量使用前必须先声明,并且一旦声明就不能再当前作用域内改变其类型. [填空题]Python内置函数__用来返回序列中的最大元素 [填空题]表达式 int(4**0.5) 的值为 ...

  2. 在python中是否可以使用if作为变量名_在Python中可以使用if 作为变量名_python使用符号 标示注释...

    在Python中可以使用if 作为变量名 答:× " src=" " style="max-width: 100%; display: inline;" ...

  3. 在python语言中不能作为变量名的是什么_4、 在 Python 中可以使用 if 作为变量名。 (1.0分)_学小易找答案...

    [判断题]2. Python 变量使用前必须先声明 , 并且一旦声明就不能在当前作用域内改变其类型. (1.0分) [填空题]Python语句''.join(list('hello world!')) ...

  4. python中if有几种使用方式_在 Python 中可以使用 if 作为变量名。 (2.0分)_学小易找答案...

    [判断题]尽管可以使用 import 语句一次导入任意多个标准库或扩展库,但是仍建议每次只导入一个标准库或扩展库. (2.0分) [简答题]写出 Python 运算符 & 的两种功能? (5. ...

  5. 下列可作为python变量名的是1name_在Python中可以使用 id 作为变量名,尽管不建议这样做。...

    在Python中可以使用 id 作为变量名,尽管不建议这样做. 答:正确 下列四环素类药物不良反应中,哪一个是错误的 答:抑制骨髓造血 There ___ no need to feel homesi ...

  6. mysql中的dateDayOfYear_Mysql 常用的时间日期及转换函数小结

    本文主要是总结一些常用的在实际运用中常用的一些mysql时间日期以及转换的函数 1.now()  :返回当前日期和时间 select now(); //2018-04-21 09:19:21 2.cu ...

  7. MonoRail学习笔记十八:在VM中可以使用哪些系统变量

    我们知道在vm中可以直接使用Session.SiteRoot等,那么我们还可以使用哪些默认的系统变量呢? 其实可以直接在vm中使用的系统变量都是在NVelocityViewEngine类的Create ...

  8. C语言中两种方式表示时间日期值time_t和struct tm类型的相互转换

    使用gmtime函数或localtime函数将time_t类型的时间日期转换为structtm类型: 使用time函数返回的是一个long值,该值对用户的意义不大,一般不能根据其值确定具体的年.月.日 ...

  9. 在python中可以使用if作为变量名_变量,注释,缩进,细数Python优雅风 | Python基础连载(二)...

    开篇 在之后的几期文章中,你将会陆续学习到Python的六个标准数据类型 不过在此之前,有一些先导内容需要掌握,所以这一期就先来介绍一下这些内容. 文章首发于微信公众号:我将在南极找寻你.专注干货分享 ...

最新文章

  1. 基础学习总结(四)--SQLite
  2. 程序员11月书讯 | 硅谷,梦开始的地方
  3. 杭电1754--I Hate It(线段树)
  4. 643 Maximum Average Subarray I
  5. Mysql 事务锁表,解决方法
  6. Android实例-手机震动(XE8+小米2)
  7. rn如何测试数据请求时间_rn最新版测试
  8. 线程执行完之后会释放吗_java多线程并发:CAS+AQS+HashMap+volatile+ThreadLocal,乐分享...
  9. Python 读取json文件
  10. 【离散数学】论域和客体函数的区别
  11. postgreSQL源码分析——索引的建立与使用——GIN索引(1)
  12. vue插件挂载html6,vue6
  13. 服务端程序的keeplive
  14. AI人工智能专业词汇集
  15. HDU-1212-Big Number【大数】
  16. 团队项目(二)(江山代有才人秃队)
  17. 分子动力学模拟学习3-Gromacs数据处理
  18. strlen函数详解
  19. 数据、变量、内存三者之间的关系
  20. 4G/5G远程网络遥控,图传系统-无人车-无人船-无人机械制作方法

热门文章

  1. DIY信号发生器:运放实现三角波、方波发生器(详细参数说明)+multisim仿真
  2. IDC:微软Windows将于2007年失去统治地位
  3. CVPR 2017:Interspeices Knowledge Transfer for Facial KeyPoint Detection(跨物种脸部关键点检测知识迁移)
  4. Vue安装element ui踩坑
  5. 魔板 Magic Squares(bfs优化)
  6. STM32+MLX90614红外测温
  7. 最强旗舰手机功能曝光:大变活人、智能静音、拍照测肤……
  8. 炫酷按钮《html》
  9. 2019-2-27-VisualStudio-插件-翻译注释
  10. 【一点唐城】15个未来高科技产品会让你无法想象、这些开脑洞的设计太牛了