Sublimetext installs packagecontrol and HTTP proxy configuration

Time:2020-2-13

PressCtrl+\`Call up the sublime command line and enter the command:

Sublime Text 3

import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; 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)

Sublime Text 2

import urllib2,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')

Manual installation

You may not be able to install with code due to various reasons. You can install package control manually through the following steps:

1. ClickPreferences > Browse Packagesmenu
2. Enter the upper directory of the opened directory, and then enterInstalled Packages/Catalog
3. Download package control.sublime-package and copy it toInstalled Packages/Catalog
4. restartSublime Text

Configuration agent

Due to the back wall of the website, the plug-in cannot be installed. You need to configure HTTP proxy at this time.

  1. openPreferences > Package Settings > Package Control > Settings - Usermenu

  2. editPackage Control.sublime-settings, add two lines:

"http_proxy": "http://127.0.0.1:8123",
"https_proxy": "http://127.0.0.1:8123"

It must be noted that the configuration file should not be mistaken. The owner of the building has stepped on the pit….
Sublimetext installs packagecontrol and HTTP proxy configuration

For students using shadowsocks, since SS is a Socks5 proxy, you need to convert it into an HTTP proxy. You can use a polipo on SS to implement it.

polipo socksParentProxy=localhost:1080

#Recommended to run in the background
nohup polipo socksParentProxy=localhost:1080 > /tmp/polipo.log &

Reference resources

  • Package Control INSTALLATION

  • Turning shadow locks into HTTP proxy with polipo

Recommended Today

The way of nonlinear optimization

Mathematical knowledge 1、 Nonlinear functionLinear function is another name of a function of first degree, then nonlinear function means that the function image is not a function of a straight line.Nonlinear functions include exponential function, power function, logarithmic function, polynomial function and so on. 2、 Taylor expansion1. Taylor formula:Taylor’s formula is to add a_ The […]