本文记录了 Sublime Text 3 的配置教程,包括一些个人常用插件的安装和使用。
环境和依赖
环境: Deeepin 15.4
依赖: Python 2.7
安装 Sublime Text 3,Sublime Text 官网
注册码,https://fatesinger.com/100121
Please support authorized software if you can.
安装包管理器
ctr+` 打开控制台,输入代码
1 | import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + |
有一次,遇到以下报错:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24Traceback (most recent call last):
File "./python3.3/urllib/request.py", line 1248, in do_open
File "./python3.3/http/client.py", line 1065, in request
File "./python3.3/http/client.py", line 1103, in _send_request
File "./python3.3/http/client.py", line 1061, in endheaders
File "./python3.3/http/client.py", line 906, in _send_output
File "./python3.3/http/client.py", line 844, in send
File "./python3.3/http/client.py", line 822, in connect
File "./python3.3/socket.py", line 435, in create_connection
File "./python3.3/socket.py", line 426, in create_connection
TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "./python3.3/urllib/request.py", line 156, in urlopen
File "./python3.3/urllib/request.py", line 469, in open
File "./python3.3/urllib/request.py", line 487, in _open
File "./python3.3/urllib/request.py", line 447, in _call_chain
File "./python3.3/urllib/request.py", line 1274, in http_open
File "./python3.3/urllib/request.py", line 1251, in do_open
urllib.error.URLError: <urlopen error [WinError 10060]
由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。>
尝试了以下解决措施:
- 安装python3,没解决,估计是网络问题
手动安装
- 点击 Preferences > Browse Packages…
- 进入 Installed Packages/ 目录
- 下载 Package Control.sublime-package,并复制文件到 Installed Packages/ 目录
- 重启 Sublime Text
再次安装失败再次手动安装
- github下载https://github.com/wbond/sublime_package_control
- 解压后把文件夹名称改为Package Control
- 点击 Preferences > Browse Packages…
- 将Package Control 复制到该文件夹中,重启sublime
ctr + shift + p
打开的窗口中输入pci
弹出窗口如下说明成功
Material Theme 主题
ctr+shift+p
输入pci
Package Control: Install Package
and press enter. Then search for Material Theme- Activate the theme :
ctr+shift+p
输入Material Theme
选择
常用插件
SublimeCodeIntel
提供代码提示,函数、对象或变量名称等。还可以提示对象或类中哪些方法和变量。基于komodo codeintel开发,虽然有时会有一些问题,但是大多时候是没问题的。SublimeLinter
代码提错工具。但是从sublime 3开始,SublimeLineter编程模块化,所以安装完主安装包之后,还需要安装你需要支持的对应的语言的插件。对于PHP+js的开发,可以安装如下插件:
SublimeLinter-php
SublimeLinter-jshint
SublimeLinter-json
and SublimeLinter-csslintVCS Gutter
编码的时候避免不了使用Git或SVN,VCS Gutter可以很方便的在代码中显示代码改动,支持Git、 Mercurial和 SubversionOrigami: 神器!可以任意的操纵sublime的屏幕,比如左右分屏,上下分屏,先上下再左右,先左右再上下。
Markdown 写作环境,OmniMarkupPriviewer
OmniMarkupPreviewer Markdown 实时预览插件,安装使用详见官网,安装过程中如果出现 404 问题,请参照 issue
TrailingSpaces 高亮多余空格,设置 Sublime 中的
trim_trialing_white_space_on_save
为 true 可对多余空格自动删除。