首先就是去官網下載安裝檔案。
注意,要下載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兩個選單了