Linux下Sublime Text 2的安裝



安裝方法1:

通過apt-get install來安裝,可以如下來做:

sudo add-apt-repository ppa:webupd8team/sublime-text-2

sudo apt-get update

sudo apt-get install sublime-text-2

 

安裝方法2:

1.官網下載安裝包:http://www.sublimetext.com/2

2.解壓並不難,隨便找個目錄解壓就行,但考慮到後面要能在命令行下方便的快速啓動,推薦解壓到/usr/lib/目錄下,我用的方法是先解壓後搬移,命令如下:

tar -xvf Sublime\ Text\ 2.0.1.tar.bz2

mv Sublime\ Text\ 2 /usr/lib/

其中的\爲轉義符

這樣做是因爲$PATH這個環境變量自動涵蓋了/usr/lib這個目錄,不用專門去修改環境變量。

然後鍵入:

ln -s /usr/lib/Sublime\ Text\ 2/sublime_text /usr/bin/sublime

3.側邊條LaunchBar設置

由於並非安裝,缺少Ubuntu桌面運行的一些基本配置,比如不能將它加入桌面側邊的啓動器,這個和通過軟件安裝中心安裝的程序不太一樣。要做到這一點,需要增加一個配置文件,放在/usr/share/appliations/路徑下,比如增加sublime.desktop,文件內容如下:

 參考配置1:

[Desktop Entry]
Version=2.0.1
Name=Sublime Text 2
GenericName=Text Editor

Exec=sublime
Terminal=false
Icon=/usr/lib/Sublime Text 2/Icon/48x48/sublime_text.png
Type=Application
Categories=TextEditor;IDE;Development
X-Ayatana-Desktop-Shortcuts=NewWindow

[NewWindow Shortcut Group]
Name=New Window
Exec=sublime -n
TargetEnvironment=Unity

參考配置2:

[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/sublime_text %F
Icon=sublime-text
Terminal=false
MimeType=text/plain;
Categories=TextEditor;Development;
StartupNotify=true
Actions=Window;Document;

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

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

 

FAQ:

漢字方面,以前ST支持的不太好,現在我驗證下來可以顯示,輸入還是有點問題。(輸入不了漢字,但是可以顯示中文字體)

插件的安裝有package control,圖形化界面,操作非常方便,zencoding等赫赫有名的東西一定要裝一下。

破解感覺不是很必要,因爲彈出窗口不算麻煩,頻率很低。

 

附QQ2012的desktop配置文件:

[Desktop Entry]
Categories=Network;InstantMessaging;
Name=QQ2012
Icon=/opt/longene/qq2012/qq2012.png
Exec=/opt/longene/qq2012/qq2012.sh
StartupNotify=true
Terminal=false
Type=Application
Name[en]=QQ2012
Name[en_US]=QQ2012
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章