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 替换成你自己定义的名字。






  • 相关阅读:
    光庭杯第九题
    NYOJ 95
    NYOJ 31
    NYOJ 26
    HDOJ 1016(DFS)
    memset和memcpy和memcpy
    周期串
    C# BackgroudWorker
    Microsoft® SQL Server® 2008 Express以及Microsoft® SQL Server® 2008 R2 SP1下载地址
    事件(Event)
  • 原文地址:https://www.cnblogs.com/itlyh/p/6024486.html
Copyright © 2011-2022 走看看