Home  >  Article  >  Backend Development  >  How to install and use Package Control in Sublime text 2/3

How to install and use Package Control in Sublime text 2/3

WBOY
WBOYOriginal
2016-08-08 09:19:011218browse

The Package Control plug-in is a plug-in that facilitates Sublime Text management plug-ins. However, because Sublime Text 3 has updated the Python functions and the API is different, many plug-ins developed based on Python cannot work, and the original installation method of Package Control is invalid.

Simple installation method:

Click View - Show Console from the menu or ctrl + ~ shortcut key to bring up the console. Paste the following Python code and enter to execute it. The installation will be completed without incident. The installation code for ST3 and ST2 is provided below:

Sublime Text 3:

  1. import urllib.request,os; pf ='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib. request.ProxyHandler()) ); open(os.path.join(ipp,pf),'wb').write(urllib.request . urlopen('http://sublime.wbond.net/'+ pf.replace(' ','%20')).read())

Sublime Text 2:

  1. import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp )ifnot os. path.exists (ipp)elseNone; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os .Path.Join ( ip, pf), 'wb') .write ( urllib2.urlopen ('http: //sublime.wbondd .net/'+pf.replace(' ','%20')).read());print('Please restart Sublime Text to finish installation')

Manual installation:

It may not be possible to install using code due to various reasons, then you can manually install Package Control through the following steps:

1. Click Preferences > Browse Packages menu

2. Enter the open directory The upper directory, and then enter the Installed Packages/ directory

3. Download Package Control.sublime-package and copy it to the Installed Packages/ directory

4. Restart Sublime Text.

Package Control main file download address: https://github.com/wbond/sublime_package_control

How to install and use Package Control in Sublime text 2/3

Usage:

Shortcut key Ctrl+Shift+P (Menu – Tools – Command Paletter), enter install and select Install Package and press Enter, enter or select the plug-in you need and press Enter to install it (note the small text changes in the lower left corner, it will prompt that the installation is successful).

How to install and use Package Control in Sublime text 2/3

How to install and use Package Control in Sublime text 2/3

Reference:

https://sublime.wbond.net/installation#st3

The above introduces the installation and use of Package Control in Sublime text 2/3, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn