zoukankan      html  css  js  c++  java
  • 编码神器之sublime(插件安装)

    一款优秀的编辑器是程序员的左膀右臂,相信每一个程序员手边都有自己熟悉的编辑器。

    从一开始使用sublime的时候就开始喜欢上了这款编辑器,被他强大的功能深深的吸引了。

    sublime的强大来源于他的扩展性,有很多现成的扩展插件和支持用户自己开发的插件,就比如伟大的eclipse和vs,他们的强大少不了很多优秀的插件支持。

    下面介绍下sublime的插件安装:(安装插件前需要首先安装sublime,点此下载,安装嘛,就不告诉你啦!)

    ●当电脑可以直接连接网络的情况下

    1.按Ctrl+`调出console(如果因为输入法冲突的话,可以调用菜单:View→Show Console)

    2.在命令行中粘贴下面命令,然后回车执行

    import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())

    3.重新启动sublime,然后查看是否正确安装

      a.如果在Perferences->package settings中看到package control这一项,则安装成功。

      b.调用命令 ctr + shift + p调用命令面板,然后输入package control,出来很多可选择的命令的时候,也证明安装成功了。

    ★还有一种办法,就是直接下载package来直接安装,首先下载package control安装包,然后将安装包拷贝到sublime的安装目录下,如我的安装目录(C:Program FilesSublime Text 2Pristine Packages),然后重启sublime,参照上述步骤三查看package control是否安装成功「废话,肯定成功」。

    上面链接是不是发现找起来比较麻烦呢?好了,你如果不想自己找的话,就点击这里下载。

    接下来就是安装插件了,根据具体需要安装需要的插件。

    1.调用命令 ctr + shift + p调用命令面板

    2.输入install package,会过滤掉剩下一个命令package control:intall package(同理,删除的话,就是remove package的命令),然后使用光标选择那个命令。

    3.接下里,会出来很多很多的插件可供你选择,可以根据关键字过滤出你需要的插件,然后选择安装。

    4.在左下角会提示插件安装的状态,当看到安装成功的字样以后,那个插件就可以使用了。

    如果你使用的代理的话,你会发现,上述描述的步骤3一直就没有出现,直到等到网络连接的timeout

    因为我们的网络是使用代理上网的,当sublime(准确的说是package control)尝试连接网络的时候,是无法连接网络的。

    这个时候需要设置下代理,设置方法参照下文:

    1.使用菜单 preferences→package settings→package control,这个里面还有两个选项(settings-default和settings-user)

    2.这个时候,我们会发现settings-default里面有很多很多东西,而settings-user是空的,我们也不管settings-default是干嘛的了,首先把settings-default里面的设置全部拷贝到settings-user配置中

    3.我们在settings-user中搜索proxy关键字,里面我们会发现几个配置

    "http_proxy": "",
    "https_proxy": "",
    "proxy_username": "",
    "proxy_password": "",

    这几个属性就是我们要修改的了,首先确认我们的代理上网设置,一般代理上网设置都是在IE中设置的

    现在我们去查看我们的IE设置去:打开IE,选择菜单(如果隐藏了就按下alt就出来了)的tools选项的internet option,弹出对话框,选择[连接]的tab,在右下角有lan设定的按钮,点击打开它,在打开的串口中就有你的代理上网设置,比如我的设置是proxy和8080,那么我的代理设置就是proxy:8080

    至于代理的用户名密码的话,你就你刚开始打开上网的时候,弹出的用户名密码框中输入的用户名和密码,比如说是user和pass

    那么,我们还是回来设置我们的sublime的代理,刚才我们在settings-user中挑出的几个要设置的配置分别要修改为

    "http_proxy": "proxy:8080",
    "https_proxy": "proxy:8080",
    "proxy_username": "user",
    "proxy_password": "pass",

    4.接下里,我们要按下ctr + s(哈哈),好了,接下里我们的sublime就可以直接上网下载插件了。

    下载的方法同上面某个地方介绍的方法。

    还有一种情况下,我们不做那么多事了,就只下载插件直接,这个么,完全可以,我们只需要将插件下载下来,点击这里寻找插件

    这里面有很多插件,搜索到自己需要的,然后下载下来,一般会下载为一个zip的文件,将下载好的zip解压,解压以后package的目录下

    package的目录一般在用户的目录,可以使用sublime的菜单打开,preference→borwse packages,这个时候就会一个文件夹,这个就是我们引用的package的目录,这个时候你会发现好好熟悉的packages,比如说Java的,C的,SP的,js的,go的,简直什么都有。

    废话不说了,放进去以后,重新启动下sublime,刚才安装的插件就生效了,就可以使用了。

    PS:sublime支持很多语言的使用,尤其是html,css,js的编写,很是方便的。

    接下来,就可以开始寻找插件之旅了。

    *****************************************************************************************************************************

    有时候,是执行package instal的时候,Sublime仍然会报错。

    There are no packages available for installation
    Package Control: Error downloading channel. Error checking for server certificate revocation (errno 12057) during HTTP write phase of downloading https://sublime.wbond.net/channel.json.
    error: Package Control

    There are no packages available for installation

    这个问题的原因因该是网站证书的原因吧!

    我们要想正常使用Package Control来安装插件的话,我们可以可以将浏览器检查证书的地方给勾掉。

    出处:http://www.genopro.com/ssl/

    HTTP Error 12057 - SSL Revocation

    This error is happening because the program GenoPro uses a secure encrypted protocol (SSL) to connect to the server GenoPro.com.  Under rare conditions, your computer may display the error below because it is unable to validate the SSL certificate.

    HTTP Error 12057: Unable to validate the revocation of the SSL certificate because the revocation server is unavailable

    You will only see the error if you are working with secure sockets (https protocol). You can turn off the check for server certification following the steps below.

    How to fix it

    This error is easy to fix and should take less than 2 minutes of your time:

      1. Open Internet Explorer.
      2. From the Tools menu, select the menu item Internet Options and click on the Advanced tab.
      3. Scroll down to the Security section, uncheck the option Check for server certificate revocation.
      4. Click on the OK button to close the Internet Options dialog.  You also need to close all instances of Internet Explorer for the changes to take effect.  If the changes do not take effect, it is possible a hidden instance of Internet Explorer may still be running in the background. In this case, just reboot your computer and it will work.
      5. Restart GenoPro.
      6. If you still get this error, turn off the other option Check for publisher's certificate revocation.

    *****************************************************************************************************************************

  • 相关阅读:
    ASP.NET Core 中的依赖注入 [共7篇]
    ASP.NET Core的配置(4):多样性的配置来源[下篇]
    ASP.NET Core的配置(4):多样性的配置来源[中篇]
    ASP.NET Core的配置(4):多样性的配置来源[上篇]
    ASP.NET Core的配置(3): 将配置绑定为对象[下篇]
    ASP.NET Core的配置(3): 将配置绑定为对象[上篇]
    ASP.NET Core的配置(2):配置模型详解
    ASP.NET Core的配置(1):读取配置信息
    ASP.NET Core中的依赖注入(5):ServicePrvider实现揭秘【补充漏掉的细节】
    ASP.NET Core中的依赖注入(5): ServiceProvider实现揭秘 【解读ServiceCallSite 】
  • 原文地址:https://www.cnblogs.com/gekal/p/3168693.html
Copyright © 2011-2022 走看看