Use the sublime snippet function to quickly create a code segment.

Source: Internet
Author: User

Use the sublime snippet function to quickly create a code segment.

In front-end development, we often enter the same basic code, such as common jquery references, bootstrap frameworks, and cssreset. If you copy and paste the code at each time, here is a more concise method.

Use the sublime snippet function to quickly create a code segment

Open Tools> New snippet and we can see the content.

If I have no basic English skills, I am a little confused. Today I will introduce how to use this super function.

First, we will briefly introduce the components of snippet:

  • content: It must contain<![CDATA[…]]>Otherwise, it cannot work and contains the code segment you want to use. The code segment shown on this page is Hello, this is a snippet. $ {1: this} indicates that the cursor is placed behind this after the code segment is obtained. $ {2: snippet} indicates that the cursor will jump from this to snippet after the Tab key is pressed, these are all for easy input of subsequent code. If the code segment you want to paste does not need to be modified, you can ignore these
  • tabTrigger: The character or string used to trigger the code snippet. For example, in the preceding example, enterhelloPress the tab and the code snippet "Hello, this is a snippet." will be output in the editor.
  • scope: Indicates that your code snippet will be activated in that language environment. For example, the above Code definessource.pythonThis code snippet will be activated in the python environment.

Now, let's show the code segments that I often use.

After this setting, enter jquery in the html page and press the Tab key to quickly obtain the code segment in snippet, that is

<Script src = "http://apps.bdimg.com/libs/jquery/1.9.0/jquery.min.js"> </script>

How are you doing? It's fast enough! You no longer need to type so many codes.

Css can also be used in this way.

This is my pc-side cssreset code segment, so that I only need to enter cssresetpc In the css page, and then press the Tab key to get the cssreset.

I can't do it any more quickly. Do you understand?

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.