Sublime Text Snippets - Sublime Text

What are Sublime Text Snippets?

Snippets are the keen formats which can be reused at whatever point required. Sublime text editor incorporates snippets highlight for HTML layouts. In this part, you will find out about them in detail.

Understanding Snippets

Snippets are basic XML supported documents with different properties. They incorporate an augmentation called sublime-snippet. The root tag of XML component will be the <snippet> tag. Snippets made are saved in the Packages folder and are considered to live in this folder.


The record arrangement and sentence structure of snippets are talked about in detail as pursues −

  • Content −This topic explains about the snippet.
  • tabTrigger − It section describes about characters which trigger when the snippet is composed.
  • Extension − It explains about the scope of snippet stays dynamic.
  • Description − It explains about the meta description. It will be displayed when snippet's menu is open.

Creating First Snippet

You can make the default snippet Using Tools → Developer → Snippet option.


At that point, a demo snippet with the related tags will be made as appeared below −


To make a first snippet in Sublime Text editor, tap the Tools menu and select the Snippets option starting from the drop window, as appeared in the screen capture here.


Presently, pick Snippet:html from the options displayed.


This makes a default snippet on the predefined html record as appeared as follows.


Note that there are different snippets for various sorts of files. For html files in the code base, there are three snippets characterized in Sublime Text editor, as appeared as follows.


Package Control Snippets

Control snippets are principally utilized for item advancement. With install packages option in Sublime editor, you can download any snippet required for web development and install it.


You may need the following packages for web development −

  • EverCodeLab Sublime supports for Ruby on Rails
  • Additional PHP snippets for PHP
  • HTML snippets for HTML files
  • Twitter Bootstrap snippets for Twitter Bootstrap
  • JavaScript snippets for JS files
  • jQuery snippets pack for jQuery

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Sublime Text Topics