zoukankan      html  css  js  c++  java
  • Sublime 代码段设置

    # Sublime 代码段

    > 依次找到:Tools -> Developer -> New Snippet,默认代码段配置文件如下:

    <snippet><content><![CDATA[
    Hello, ${1:this} is a ${2:snippet}.
    ]]></content><!-- Optional: Set a tabTrigger to define how to trigger the snippet --><!-- <tabTrigger>hello</tabTrigger> --><!-- Optional: Set a scope to limit where the snippet will trigger --><!-- <scope>source.python</scope> --></snippet>

    配置文件是 XML 格式,含义如下:

    • snippet: 父节点,必须
    • content: 内容节点,将要定义的代码段写到该节点下
    • tabTrigger: 触发节点,设置触发源
    • scope: 代码段生效作用域
    • ${number:}: Tab 按键切换的光标

    下面是一个 Demo:

    <snippet><content><![CDATA[
    Hello, ${1:this} is a ${2:snippet}.
    ]]></content><!-- Optional: Set a tabTrigger to define how to trigger the snippet --><tabTrigger>hello</tabTrigger><!-- Optional: Set a scope to limit where the snippet will trigger --><!-- <scope>source.python</scope> --></snippet>

    接下来 Ctrl + s 保存该文件,写入文件名:hello.sublime-snippet , 然后到文件中通过输入 hello 触发给代码段。

    注意:最后保存文件的时候,必须是 xxx.sublime-snippet 的名字保存,其中 xxx 替换成你自己定义的名字。






  • 相关阅读:
    zabbix4.4安装和简要设置
    SAMBA服务
    NFS服务
    Rsync+inotify数据同步
    Linux上FTP部署:基于mariadb管理虚拟用户
    rsyslog日志服务部署
    Typora自动生成标题编号
    编译安装LAMP
    303. 区域和检索
    [leetcode]53. 最大子序和*
  • 原文地址:https://www.cnblogs.com/itlyh/p/6024486.html
Copyright © 2011-2022 走看看