`

Sublime Package Control

 
阅读更多

今天主要介绍Sublime Text2 的 package control.

资料地址:http://wbond.net/sublime_packages/package_control/installation

 

Installaton

 

 

Please note that the following method can not validate the sublime.wbond.net SSL certificate. If you have concern over the security of the download, please follow the Manual Instructions below.

 

Installation is through the Sublime Text 2 console. This is accessed via the ctrl+` shortcut. Once open, paste the following command into the console.

 

import urllib2,os; 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())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print('Please restart Sublime Text to finish installation')

 

This command creates the Installed Packages folder for you (if necessary), and then downloads the Package Control.sublime-package into it.

Start Managing Your Packages

Manual Instructions

 

If for some reason the console installation instructions do not work for you (such as having a proxy on your network), perform the following steps to manually install Package Control:

 

  1. Click the Preferences > Browse Packages… menu entry
  2. Browse up a folder and then into the Installed Packages folder
  3. Download Package Control.sublime-package and copy it into the Installed Packages directory
  4. Restart Sublime Text

 

Testing Version

 

If you want to help test the latest changes, or you are having trouble with the stable version (v1.6.3) of Package Control, please use the instructions below to install the testing version (v1.6.9.0). See the testing version changelog on GitHub.

 

Notable changes include:

 

  • Refactoring in prep to support Python 3 for Sublime Text 3.

 

Upgrade

 

If you already have Package Control installed and want to help test the new version.

 

  1. Run the Package Control: Add Repository command via the command palette and enter the following URL:
    https://sublime.wbond.net/testing/packages.json
  2. Run the Package Control: Upgrade Package command and select Package Control from the list

 

Manual Install

 

If Package Control is not currently working for you, you’ll have to manually install.

 

  1. Click the Preferences > Browse Packages… menu entry
  2. Browse up a folder and then into the Installed Packages folder
  3. Download the testing version of Package Control.sublime-package and copy it into the Installed Packages directory
  4. Restart Sublime Text
  5. Run the Package Control: Add Repository command via the command palette and enter the URL to keep the testing version of Package Control up-to-date:
    https://sublime.wbond.net/testing/packages.json

 

Sublime Text 3

 

There is an alpha quality release of Package Control for Sublime Text 3 available. Please note that it currently functions the same as for ST2, however there will be changes in the future to properly support the new preferred method of keeping .sublime-package files on disk instead of extracting them to the Packages/ folder.

 

Please use GitHub issues and prefix all bug titles with ST3: .

 

Git Install

 

Since Sublime Text 3 no longer extracts the contents of .sublime-package files by default, and the fact that Package Control needs to read CA cert files from disk for SSL certificate verification, the only viable install method right now is via Git.

 

Please note, the Packages/ folder listed below refers to the folder that opens when you use the Preferences > Browse Packages…menu.

 

cd Packages/
git clone https://github.com/wbond/sublime_package_control.git "Package Control"
cd "Package Control"
git checkout python3

 

Testing on Sublime Text 2

 

The new version of Package Control is targetted at both Sublime Text 2 and Sublime Text 3. If you are still running ST2, and can help, please spend some time testing to make sure it does not regress.

 

  1. Run the Package Control: Add Repository command via the command palette and enter the following URL:
    https://sublime.wbond.net/alpha/packages.json
  2. Run the Package Control: Upgrade Package command and select Package Control from the list

 

 

Usage

 

Package Control is driven by the Command Pallete. To open the pallete, press ctrl+shift+p (Windows, Linux) or cmd+shift+p (OS X). All Package Control commands begin with Package Control:, so start by typing Package.

 

The command pallete will now show a number of commands. Most users will be interested in the following:

 

Install Package
Show a list of all available packages that are available for install. This will include all of the packages from the default channel, plus any from repositories you have added.
Add Repository
Add a repository that is not included in the default channel. This allows users to install and automatically update packages from GitHub and BitBucket. To add a package hosted on GitHub, enter the URL in the form https://github.com/username/repo. Don’t include .git at the end! BitBucket repositories should use the format https://bitbucket.org/username/repository.
Remove Package
This removes the package folder, and the package name from the installed_packages list in Packages/User/Package Control.sublime-settings. The installed_packages list allow Package Control to automatically install packages for you if you copy your Packages/User/ folder to another machine.

 

By default Package Control checks for new versions on startup. This setting, plus the list of channels and repositories are managed through theSettings.

 

Additional commands include:

 

Add Repository Channel
Adds another channel that lists repositories. This is uncommon, but allows users to create a custom channel of repositories to share.
Create Package File
For package developers. Takes a package folder and generates a .sublime-package file that can be uploaded onto the web and referenced in the packages.json file for a repository.
Create Binary Package File
For package developers. Creates a .sublime-package file that does not include the source .py files, but instead the .pyc bytecode files. This is useful to distribute commercial packages. Be sure to check the resulting .sublime-package file to ensure that at least one .py file is included so that Sublime Text will load the package.
Disable Package
Disables a package, which causes any Python scripts to be unloaded, and other files such as .sublime-keymap files to be unloaded also.
Discover Packages
Opens up a web browser to the Community Packages list.
Enable Package
Re-enables a package that has been disabled.
Upgrade/Overwrite All Packages
This will upgrade ALL packages, including ones that were not installed via Package Control. If you are developing a custom copy of a package, you may not want to use this command.
Upgrade Package
Show a list of packages that are available for upgrade and let the user pick which they would like to update.
Package Control Settings – Default
Open the default settings file, which can be used as a reference for changing the User settings. Any changes to this file will be lost whenever Package Control is automatically or manually upgraded.
Package Control Settings – User
Opens the user’s settings for Package Control. Any settings changes should be saved here so they are not overwritten when a new version of Package Control is released.

 

 

 

 

Settings

The default settings can be viewed by accessing the Preferences > Package Settings > Package Control > Settings – Default menu entry. To ensure settings are not lost when the package is upgraded, make sure all edits are saved to Settings – User.

debug
If set to true, will print HTTP headers and other debug information to the Sublime Text console.
Default: false
submit_usage
If installs, upgrades and removals should be logged to the reporting URL. This data will be used to power the community package listing and will be displayed in aggregate only. No user-identifiable information is sent, just the: package name, operation, package version, package control version, sublime version and sublime platform.
Default: yes
submit_url
Where the usage information should be sent to.
Default: "http://sublime.wbond.net/submit"
installed_packages
A list of packages that have been installed. Package Control will automatically install any packages in this list that are not currently installed, allowing this to be used for sharing package lists with other users. This setting is only tracked in Settings – User.
Default: []
repository_channels
A list of URLs that each contain a JSON file with a list of repositories. The repositories from these channels are placed in order after the repositories from the repositories setting.
Default: ["http://sublime.wbond.net/repositories.json"]
repositories
A list of URLs that contain a packages JSON file. These repositories are placed in order before repositories from the repository_channelssetting.
Default: []
package_name_map
This helps solve naming issues where a repository it not named the same as the package should be. This is primarily only useful for GitHub and BitBucket repositories. This mapping will override the mapping that is retrieved from the repository channels.
Default: {}
auto_upgrade
If packages installed via Package Control should be checked for updates when Sublime Text starts. Updates will be automatically installed.
Default: true
auto_upgrade_frequency
The number of hours to wait before trying to auto upgrade packages again.
Default: 6
auto_upgrade_ignore
Packages to exclude from the auto upgrade functionality.
Default: []
install_missing
If set to false, will not automatically install packages from the installed_packages setting that are not present on the current machine. This is really only useful if you don’t want Sublime Text to connect to the internet without explicitly requesting it. In that case you’ll want to setauto_upgrade to false also.
Default: true
timeout
The HTTP timeout (in seconds) to use when downloading channels, repositories and packages.
Default: 30
cache_length
The number of seconds to cache channel and repository metadata for.
Default: 300
http_proxy
The proxy to use for HTTP requests. Should be in the form domainname:port or ip:port.
Default: ""
https_proxy
The proxy to use for HTTPS requests. If http_proxy is set and this settings is not, the value from http_proxy will be used. If set to false, thenhttp_proxy will not be inherited. Should be in the form domainname:port or ip:port.
Default: ""
proxy_username
The username to use for proxy authentication. Default: ""
proxy_password
The password to use for proxy authentication. Default: ""
user_agent
The user agent used by the various downloaders. Default: "Sublime Package Control"
git_binary
The path to git, when using a git repository to track a package. When an empty string, Package Control will look in default locations for the current OS.
Default: ""
git_update_command
The parameters passed to git to update a package.
Default: ["pull", "origin", "master"]
hg_binary
The path to hg, when using an hg repository to track a package. When an empty string, Package Control will look in default locations for the current OS.
Default: ""
hg_update_command
The parameters to pass to hg to update a package. Be sure to keep the remote name as the last parameter, even if it is default.
Default: ["pull", "--update", "default"]
ignore_vcs_packages
If git and hg repositories should be ignored when trying to update packages.
Default: false
dirs_to_ignore
A list of folders to ignore when creating a .sublime-package file.
Default: [".hg", ".git", ".svn", "_darcs", "CVS"]
files_to_ignore
A list of file glob patterns to ignore when creating a .sublime-package file.
Default: [".hgignore", ".gitignore", ".bzrignore", "*.pyc", "*.sublime-project", "*.tmTheme.cache"]
package_destination
The folder to copy a newly created package to. Default to the user’s Desktop if blank. Setting this destination to the Installed Packagesdirectory will cause your source code changes to be overwritten when Sublime Text restarts!
Default: ""
certs

A list of CA cert information for the purpose of providing a secure way to download packages. A default list is provided with Package Control, but then the default repository channel provides updates to the list. It is also possible to add your own entries for custom download locations, or for supporting your local proxy server.

To add your own, be sure to copy the JSON object below and then add your custom entries. The key in the JSON object is the domain the cert applies to. The value is an array with two elements, the first being an identifier for the cert, and the second being a location to copy the cert from. The identifier is used to ensure that Package Control has a copy of the latest version of the cert in its certs/ folder. The location can be either an absolute file path on your local machine, or a URL to download it from.

To create a CA cert that is ensured to be present no matter what domain is being accessed (such as for a proxy server), set the domain name to *, like in the example on the next line:

"*": ["my_proxy_cert", "/file/path/to/proxy/ca_certs"]

This ca cert needs to live somewhere on your machine permanently so that it can be re-added to the ca-bundle.crt file that is provided with each Package Control upgrade.

Default:
{
    "api.bitbucket.org": ["d867a7b2aecc46f9c31afc4f2f50de05", ""],
    "api.github.com": ["1c5282418e2cb4989cd6beddcdbab0b5", ""],
    "bitbucket.org": ["897abe0b41fd2f64e9e2e351cbc36d76", ""],
    "nodeload.github.com": ["1c5282418e2cb4989cd6beddcdbab0b5", ""],
    "raw.github.com": ["1c5282418e2cb4989cd6beddcdbab0b5", ""],
    "sublime.wbond.net": ["7f4f8622b4fd001c7f648e09aae7edaa", ""]
}

 

分享到:
评论

相关推荐

    Sublime Package Control channel_v3.json

    Sublime 3, Package Control安装扩展包所需的配置json。

    离线安装sublime text3 Package Control: Install Package

    Package Control是Sublime Text的一个关键插件,它允许用户轻松地安装、更新和管理其他插件,极大地提升了编辑器的功能和效率。本文将详细介绍如何在没有网络的情况下离线安装Sublime Text 3的Package Control及其...

    Sublime PackageControl 手动全套资料

    Sublime 可以安装各种 插件 , 可以通过 PackageControl 安装. 里面含有 Channel_v3.json 可以解决 Install Package 时候 出现的 There are no package ...... 问题!!!

    sublime package control 插件

    出现package control 无法或得连接,无法自动下载的时候,可以直接用这个插件。直接放到 插件目录中重启就可以了。

    Sublime Text 3:Package Control channel_v3.json

    1.最新的channel_v3.json 2.最近使用sublime text 3通过...只需要打开首选项->插件设置->Package Control->Settings-Default,把https://packagecontrol.io/channel_v3.json改成本地目录C:/channel_v3.json即可。

    解决Sublime包管理package control 报错 There are no packages available for installation

    解决Sublime包管理package control 报错 There are no packages available for installation,解压后是真实可用的 channel_v3.json文件

    Package Control.sublime-package

    Package Control 是Sublime Text中的一款极其重要的插件管理器,它允许用户方便地安装、更新和卸载Sublime Text的各种插件。标题提到的 "Package Control.sublime-package" 文件是这个插件的核心组件,用于实现插件...

    Sublime的Package Control插件安裝包及安装方法.zip

    Package Control是Sublime Text的一个核心插件,它为用户提供了便捷的方式来安装、更新和管理其他第三方插件,极大地提升了Sublime Text的功能和用户体验。 首先,让我们详细了解一下如何安装Package Control。在...

    Sublime Text 及Package Control文件

    2. **使用Package Control安装插件**:安装完成后,重启Sublime Text,再次打开命令面板(`Cmd+Shift+P`或`Ctrl+Shift+P`),输入`PCIP`,选择`Package Control: Install Package`,系统会列出所有可用的插件。...

    SublimeText3PackageControl安装包

    1. **访问官网下载**:首先,你需要去官方网站 (<https://packagecontrol.io/installation>) 查看最新的安装指南。通常,最新版本的 Package Control 安装文件会随着 Sublime Text 的更新而更新。 2. **手动安装**...

    Sublime Test 3 Package Control

    **Sublime Text 3 Package Control** 是一个强大的插件管理工具,它为Sublime Text 3这个流行的文本编辑器提供了方便快捷的插件安装、更新和管理功能。Package Control是Sublime Text生态系统的重要组成部分,极大地...

    sublime_package_control-master.zip

    Package Control是Sublime Text的一个核心扩展工具,它允许用户方便地安装、管理和更新各种插件,极大地丰富了Sublime Text的功能。"sublime_package_control-master.zip"就是这个工具的源代码压缩包。 在Sublime ...

    sublime2的package control扩展包

    1. 打开浏览器,访问 Package Control 官方网站(https://packagecontrol.io/installation),复制提供的安装命令。 2. 在 Sublime Text 中,按下 `Ctrl+` (Windows 和 Linux) 或者 `Cmd+` (Mac) 打开命令面板。 3. ...

    sublime text package control

    Package Control是Sublime Text的一个核心插件,它为用户提供了便捷的方式来管理和安装Sublime Text的各种插件。下面我们将深入探讨Package Control的工作原理、安装方法以及如何利用它来增强Sublime Text的功能。 ...

    sublime_package_control-python3.zip

    Package Control是Sublime Text的一个核心扩展,它允许用户方便地安装、管理和更新各种插件,极大地提升了开发效率。"sublime_package_control-python3.zip"文件正是为了在Sublime Text中安装和管理Emmet插件而准备...

    sublimetext3 Package Control

    首先,你需要访问官方网站(packagecontrol.io)获取安装指南,或者在 Sublime Text 3 中使用命令面板(快捷键通常是 `Ctrl+Shift+P` 或 `Cmd+Shift+P`)输入 "Package Control: Install Package" 命令来自动安装。...

Global site tag (gtag.js) - Google Analytics