Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Sublime Text installation


May 24, 2021 Sublime Text Use the manual


Table of contents


Installation

Sublime Text's official web site offers downloads of all versions of Sublime Text, and the latest version of Sublime Text is currently Sublime Text 3. Here's an example of a Windows version of the Sublime Text installation.

Note Check add to explorer context menu at installation so that you can open it directly with Sublime Text when you right-click on the file.

Sublime Text installation

Add Sublime Text to the environment variable

Run sysdm with Win-R .cpl open System Properties.

Sublime Text installation

Then select Environment Variables in the Advanced tab, edit Path, and add the installation directory for Sublime Text (for example, D: Program Files Subblime Text 3).

Sublime Text installation

Next you can use the sublime text directly from the command line using the subbl command:

subl file :: 使用Sublime Text打开file文件
subl folder :: 使用Sublime Text打开folder文件夹
subl . :: 使用Sublime Text当前文件夹

Install Package Control

As mentioned earlier, Sublime Text supports a large number of plug-ins, and how to find and manage them becomes a problem, and Package Control is designed to solve this problem, making it easy to browse, install, and uninstall plug-ins in Sublime Text.

Go to Package Control's website, which has detailed installation tutorials. Package Control supports Sublime Text 2 and 3, and this article only describes the installation process for 3:

  • Open the Sublime Text console using Ctrl s' .
  • Paste the following code into the console:
import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; 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://sublime.wbond.net/' + 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)
  • Wait for the Package Control installation to complete. Then open the command board using Ctrl and Shift and P, and enter that the PC should have Package Control:

Sublime Text installation

After the successful installation of Package Control, we can easily install various plug-ins using Sublime Text:

Sublime Text installation