Home Web Front-end JS Tutorial How to write code blocks with sublime

How to write code blocks with sublime

Sep 11, 2017 am 09:47 AM
sublime code write

今天在用canvas绘图时,看到有许多相同的代码,就想介绍sublime里面为了加快代码编写,而采用代码片段。
这里只写我了解的。其他需要,请读者自行了解。

打开位置,见下图:

How to write code blocks with sublime

  • 打开页面

    How to write code blocks with sublime

  • 例子

<How to write code blocks with sublime>
    <content>
        <![CDATA[
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>${1}</title>
</head>
<body>
    <canvas id="demo">
    </canvas>
    <script>
    (function() {
        var canvas = document.getElementById(&#39;demo&#39;);
        canvas.width = ${2:agewg};
        canvas.height = ${3};
        canvas.style.border = &#39;1px solid #000&#39;;
        var ctx = canvas.getContext(&#39;2d&#39;);
       ${4}
        ctx.stroke();
    })();
     \$(function() {

  });
    </script>
</body>
</html>
]]>
    </content>
    <!-- Optional: Set a tabTrigger to define how to trigger the How to write code blocks with sublime -->
    <tabTrigger>cans</tabTrigger>
    <!-- Optional: Set a scope to limit where the How to write code blocks with sublime will trigger -->
    <!-- <scope>source.python</scope> --></How to write code blocks with sublime>下面图片和上面代码块一样的内容,为了说明清楚,加的图片:
Copy after login

How to write code blocks with sublime

How to write code blocks with sublime

  • 保存
    How to write code blocks with sublime

  • 输入快捷键

How to write code blocks with sublime

The above is the detailed content of How to write code blocks with sublime. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What should I do if the notepad file is too large to open? What should I do if the notepad file is too large to open? Apr 08, 2024 am 03:15 AM

What should I do if the notepad file is too large to open?

How to align text columns in notepad How to align text columns in notepad Apr 08, 2024 am 01:00 AM

How to align text columns in notepad

What should I use to open html? What should I use to open html? Apr 21, 2024 am 11:33 AM

What should I use to open html?

What software is good for python programming? What software is good for python programming? Apr 20, 2024 pm 08:11 PM

What software is good for python programming?

How to use the copied code in python How to use the copied code in python Apr 20, 2024 pm 06:26 PM

How to use the copied code in python

How to open local file in html How to open local file in html Apr 22, 2024 am 09:39 AM

How to open local file in html

How to create py file in python How to create py file in python May 05, 2024 pm 07:57 PM

How to create py file in python

How to open html files on mobile phone How to open html files on mobile phone Apr 05, 2024 am 08:06 AM

How to open html files on mobile phone

See all articles