1

首先就是去官网下载安装文件。
注意,要下载Ubuntu/tarball包
或者用wget下载

wget https://download.sublimetext.com/sublime_text_3_build_3114_x64.tar.bz2

再解压文件,我把他安装到/opt、目录下

tar jxvf sublime_text_3_build_3114_x64.tar.bz2 -C /opt

可以直接命令行运行了

# cd /opt/sublime_text_3
# ./sublime_text

创建桌面快捷方式

# cp /opt/sublime_text_3/sublime_text.desktop /usr/share/applications

更改配置文件

# vim /usr/share/applications/sublime_text.desktop

我的配置如下

[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
Exec=/opt/sublime_text_3/sublime_text %F
Terminal=false
MimeType=text/plain;
Icon=/opt/sublime_text_3/Icon/48x48/sublime-text.png
Categories=TextEditor;Development;
StartupNotify=true
Actions=Window;Document;

[Desktop Action Window]
Name=New Window
Exec=/opt/sublime_text_3/sublime_text -n
OnlyShowIn=Unity;

[Desktop Action Document]
Name=New File
Exec=/opt/sublime_text/sublime_text_3 --command new_file
OnlyShowIn=Unity;

双击桌面图标,打开Sublime Text 3
因为初次启动,可能会要求你输入注册信息,
这里先分享个注册码

—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
93F6323C FD7F7544 3F39C318 D95E6480
FCCC7561 8A4A1741 68FA4223 ADCEDE07
200C25BE DBBC4855 C4CFB774 C5EC138C
0FEC1CEF D9DCECEC D3A5DAD1 01316C36
—— END LICENSE ——

使用Ctrl+`快捷键或者通过View->Show Console菜单打开命令行,粘贴如下代码:

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())

如果顺利的话,此时就可以在Preferences菜单下看到Package Settings和Package Control两个菜单了


阿修罗王
105 声望2 粉丝