Transferred from: https://www.cnblogs.com/xiaocaiyuxiaoniao/p/7838660.html
First, preface
Use sublime Text also has several years, version also upgraded from 2 to 3, but like cold days drink ice water, warm and cool to know. Initially also do not know where to start, the whole of the whole land to find information, but can access to the information, suffering from their fragmented, one-sided, not enough system and comprehensive, so all the way, consuming a lot of my time and energy. So Mongolia wrote this "Sublime Text 3 Full Detail Guide", one of their own experience is a summary, and second can give beginners a systematic, comprehensive guidance, so that they walk away from me at that time detours, so can quickly master Sublime Text this excellent editor.
The version I am currently using is the beta version of sublime Text 3 Build 3083, which is already fairly stable. So all the explanations in this article are based on this version and are examples of the Windows 7 x64 platform. There is no big difference between the other versions.
Second, Sublime Text features
1. Sublime Text is a cross-platform code editor that can be used under Linux, OS X, and Windows.
2, Sublime Text is extensible, and contains a lot of practical plug-ins, we can install their own domain plug-in to multiply productivity.
3. Sublime Text is the best choice under the command line environment and graphical interface environment, while using both will greatly improve work efficiency.
4, Sublime Text for the fee software, it is recommended to have the ability to pay for use to support developers. But you can always use it without buying it.
Third, download and install
1, Download: The official version is v2.0.2, we open the official website download link http://www.sublimetext.com/3, download sublime Text 3 Build 3083.
where "Windows Sublime" is downloaded to the "3083 x64 Setup.exe" installation program; "Portable version" is downloaded as "Sublime text build 3083 X64.zi" P "Editor package that can be run without installation after decompression.
If your computer platform is Windows x86, which is a 32-bit system, click "Windows" to download the 32-bit installer, and if you do not want to install it, click on "Portable Version" to download its 32-bit editor package.
2, Installation: Double-click the previous step downloaded "Sublime Text Build 3083 x64 Setup.exe", remember to select "Add to Explorer context menu", add it to the right-click shortcut menus. Others are installed with the default settings.
3, installation finished, double-click the desktop "Sublime Text 3" shortcut icon, open the program, you can see "Sublime Tex of the Truth."
4, if you do not put "Sublime Text 3" installed in the default path, such as you install it on the D drive, please add environment variables.
Iv. setting fonts and font sizes
Click the menu "Preferences--->setting-user" and open "preferences.sublime-settings".
Add the desired code as shown below and set it to your liking. Set the font with "Font_face": "Font name", set the font size with "font_size": "Font size", note that they need to be separated by commas.
Five, install the plug-in
Learn sublime text extension before installing, let us first understand its plug-in official website: https://packagecontrol.io/.
When we enter the keyword of the plugin in the search box, the relevant plugin will be shown in real time below, we can choose the plugin we want to understand.
1. Install the package Control
The package control is a plug-in Management Pack, so we'll install it first. With it, we can easily browse, install and uninstall plugins in sublime text.
Open the page https://packagecontrol.io/of the package control and click on the "Install Now" button on the right.
Go to the Https://packagecontrol.io/installation#st3 page, select the "SUBLIME TEXT 3" tab and copy the code snippet inside:
import urllib.request,os,hashlib;
h = 'eb2297e1a458f27d836c04bb0cbaf282' + 'd0e7a3098092775ccb37ca9d6b2e4b7d';
pf = 'Package Control.sublime-package';
ipp = sublime.installed_packages_path();
urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) );
by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read();
dh = hashlib.sha256(by).hexdigest();
print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
Double-click the desktop "Sublime text 3" To open the program, the shortcut key Ctrl + ' Open the Sublime Text console, paste the previously copied code into the console, press the "Eenter" key.
Wait for its installation to close the program, restart the "Sublime Text 3", click the Menu "Preferences" visible "package Control" item, indicating that the plug-in Management Pack has been installed successfully.
2, ConvertToUTF8 plug-in installation
A) function Description: ConvertToUTF8 can be in addition to UTF8 encoding other encoding files in the Sublime Text transfer to UTF8 encoding, the opening of the file at the beginning of the display garbled, and then a flash automatically display the normal font, of course, The encoding format of the original file does not change after saving the file.
b) Installation method One: shortcut key ctrl+shift+p, open the "Command Palette" hover dialog box, enter "Install" at the top, and then click "Package Control:install Package".
In the Hover dialog box that appears, enter "Convert" and click on the "ConvertToUTF8" plugin below to start the installation automatically, please wait patiently.
When the plugin is successfully installed, the status bar at the bottom of the Sublime Text 3 editor will prompt for successful installation.
c) Installation Method II: You can also download the complete plug-in package after decompression, put into the C:\Users\userName\AppData\Roaming\Sublime Text 3\packages directory, to achieve the purpose of installing plug-ins. Download Address: https://github.com/seanliang/ConvertToUTF8.
How to find the Packages directory. A quick way to do this is: double-click on your "Sublime Text 3", click on the menu "Preferences--->browse Packages ...".
It will directly open the directory "Packages" where the plugin package resides. Then you can copy the downloaded plug-in package into this Packages directory.
Of course, if you're familiar with Git, you can also use Git to clone plug-ins directly from the plugin's GitHub library to the Packages directory.
Note: In the future all plug-ins can be installed through the two methods described above, will not repeat, recommended method one, using the "package Control" to install plug-ins.
3. Brackethighlighter Plug-in
Feature Description: Highlight matching brackets, quotes, and labels.
Plugin Address: https://github.com/facelessuser/BracketHighlighter/tree/BH2ST3
4. Less plugins
Feature Description: Less syntax highlighting.
Plugin Address: Https://github.com/danro/LESS-sublime
5. Sublime-less2css Plug-in
Function Description: Compile the less file into a CSS file.
Plugin Address: https://github.com/facelessuser/BracketHighlighter/tree/BH2ST3
Accessibility: Download less.js-windows from https://github.com/duncansmart/less.js-windows after installation, and then configure Less.js-windows environment variables.
6. Emmet Plug-in
Function Description: Emmet's predecessor is the famous Zen Codin. Front-end development essentials, HTML, CSS code to quickly write artifacts.
How to use: Default shortcut key tab
Plugin Address: Https://github.com/sergeche/emmet-sublime
Auxiliary tool: PyV8 Download Address: https://github.com/emmetio/pyv8-binaries
Note: Emmet plug-in requires PYV8 plug-in support, so when installing Emmet, the PyV8 plug-in will be installed automatically, if the Emmet after installation is not properly insured, it is likely because PyV8 is not installed completely, Sublime Text 2 and 3 prone to this problem. You can delete it and then manually download it using the method two to install the PyV8 plugin.
Example of how to use: Write code Ul#nav>li.item$*8>a{item $}
Then place the cursor at the end of this line of code and press the TAB key to generate it automatically:
<ul id= "NAV" >
<li class= "item1" ><a href= "" >item 1</a></li>
<li class= "item2" ><a href= "" >item 2</a></li>