1\ Add the PPA and install Sublime Text 2 in Ubuntu
- sudo add-apt-repository ppa:webupd8team/sublime-text- 2
- sudo apt-get update
2\
- sudo apt-get install sublime-text- 2 -beta
- or
- sudo apt-get install sublime-text- 2 -dev
3\ 右键菜单open with增加Sublime Text2
第二步安装了后会生成 /usr/share/applications/sublime-text-2.desktop
sudo gedit ~/.local/share/applications/mimeapps.list
参考gedit增加一行
text/plain=sublime-text-2.desktop;
4\ 增加别名
gedit ~/.bashrc
增加以下:
#Sublime Text 2
alias sub='sublime-text-2'
5\ 单独安装包下载:
http://www.sublimetext.com/
1.到官方(注: http://www.sublimetext.com/ )网站下载适合ubuntu版本的tar.bz2,解压
1
|
tar
xf
Sublime
\
Text
\
2.0.1.tar.bz2
|
2、移动到更加合适的位置,这里选择/usr/lib
1
|
sudo
mv
Sublime
\
Text
\
2
/
usr
/
lib
/
|
3.如果想在终端中使用sublime
1
|
sudo
ln
-
s
/
usr
/
lib
/
Sublime
\
Text
\
2
/
sublime_text
/
usr
/
bin
/
sublime
|
4.创建可以在Unity中使用的图标
1
|
sudo
sublime
/
usr
/
share
/
applications
/
sublime
.
desktop
|
将下面的内容paste进来
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
[
Desktop
Entry
]
Version
=
1.0
Name
=
Sublime
Text
2
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName
=
Text
Editor
Exec
=
sublime
Terminal
=
false
Icon
=
/
opt
/
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
|
(注:上面具体的一些,应该可以的大概知道啥意思的.)
5.将一些文件格式打开用sublime,这里完全替代了gedit的.
1
|
sudo
sublime
/
usr
/
share
/
applications
/
defaults
.
list
|
(注:根据实际情况,自己选择合适路径,本人亲测可以用.但是呢,发现中文输入不进去,- -!这个又要解决了.大家斟酌)