Sublime Text-related operations

Source: Internet
Author: User

I. About Sublime Text

It can quickly improve development efficiency, portability, flexibility, portability, and strength. This is my definition label for it. Although it takes a short time to contact her, I am very impressed. I would like to summarize the commonly used operations or shortcut keys.

Recommended reading:

Http://www.iplaysoft.com/sublimetext.html

Http://www.cnblogs.com/cocowool/archive/2012/07/01/2572011.html

Ii. Common Sublime Text2 shortcut keys

1. F11 and Shift + F11 go to full-screen do-not-Disturb Mode

2. Ctrl + L: select the entire line, and press and hold to continue to select the next line

3. Ctrl + KK: delete from the cursor to the end of the entire row

4. Ctrl + Shift + D: copy the entire row where the cursor is located and insert it before this row.

5. Ctrl + J: Merge rows (multiple rows to be merged have been selected). It can be understood as "Do not wrap" until the line breaks automatically after the editor border is met.

6. Ctrl + D: select a word. (Press and hold-continue to select the next same string)

7. Ctrl +/: comment out the entire line and switch back and forth. Submlie Text can automatically determine the file type. Select the entire segment. You can also comment out the entire segment.

8. Ctrl + Shift +/: comment. Select the entire segment. You can also comment on the entire segment. When a single line is used, the comment information of the line is added, as shown in </ul> <! -->

9. Alt +.: Close the current tag

10. Ctrl + Shift + [: Collapse code

11. Ctrl + Shift +]: Expand the code

12. Shift + table: Indent left and Tab to right

Others:

(1) press the shortcut key ctrl + 'or Click Tools → Command Palette to bring up the Console

This console is Python. Of course we can write Python commands on it, such:

Iii. Common plug-ins

1. Package Control)

Open Sublime Text 2, press the shortcut key ctrl + ', or click Tools → Command Palette to bring up the Console;

Copy and paste the following code into the command line and press Enter:

Import urllib2, OS; pf = 'package Control. sublime-package '; ipp = sublime. installed_packages_path (); OS. makedirs (ipp) ifnot OS. path. exists (ipp) elseNone; open (OS. path. join (ipp, pf), 'wb '). write (urllib2.urlopen ('HTTP: // sublime.wbond.net/'{pf.replace ('', '% 20 ')). read ())

Restart Sublime Text 2. If you see Package Control in Preferences → Package Settings, the installation is successful.

2. Complete Alignment code

Press ctrl + shift + P to bring up the Command Panel; enter install to bring up the Package Control: Install Package option, and press ENTER; enter Alignment, select and press enter to install;

Restart Sublime Text 2, select the Text, and press ctrl + alt + a to align the Text.

Note: it conflicts with the QQ hotkey and needs to be modified.

3. Zen Coding

The CSS selector-like syntax is used to quickly develop HTML and CSS. Zen Coding is composed of two core components: an abbreviation extender (a CSS-like selector) context-independent HTML Tag pair.

When using ZenCoding to write code, follow the abbreviated rules:
  1. Eelement name (div, p );

  2. E # id element (div # content, p # intro, span # error );

  3. E. class contains the elements of class (div. header, p. error). The id and class can be written together, div # content. column

  4. E> N sub-elements (div> p, div # footer> p> span)

  5. E * N multiple elements (ul # nav> li * 5>)

  6. E + N Multiple Elements

  7. E $ * N element with serial number

For example:

4. tag

The Tag plug-in can provide html and css labels for web developers, which is convenient and convenient. It is very useful for web Front-end designers.

6. Pytag

Tag plug-in for Python code

7. Prefixr

Css-Css3 provides some prefixes

8. SublimeTmpl

Create a custom file. common panel types such as html, css, and js are added by default, press ctrl + alt + h/ctrl + alt + c/ctrl + alt + j to create a three-minute file. The shortcut keys are \ Packages \ SublimeTmpl \ Default (Windows ). sublime-keymap. The template file is here \ Packages \ SublimeTmpl \ templates, which can be modified. For example:

Html:

4. Software settings

Click preferences ---- setting user. The personal settings are as follows:

{// Font size "font_size": 13.0, // font_face ":" Las las ", // set the spacing from each row to the top, in pixels, the effect is equivalent to the line spacing "line_padding_top": 2, // set the spacing from each row to the bottom, in pixels. The effect is equivalent to the line spacing "line_padding_bottom": 2, // highlight the two ends of the tag where the cursor is located in html and xml, which affects "match_tags", such as HTML, XML, and CSS ": true, // whether to display the code fold_buttons": true, // code prompt "auto_complete": true, // default encoding format "default_encoding": "UTF-8", // left sidebar folder Animation "tree_animation_enabled": true, // Delete the plug-in "ignored_packages": ["Vintage", "YUI Compressor"]} You want to ignore.

Http://www.lupaworld.com/article-219857-1.html for more information

V. Summary

A good experience, more use of plug-ins and shortcuts will be completed in practical applications in the future, but also hope that readers can make up.

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.