Linux下Sublime Text 2的安装

19. December 2015 Linux 0

安装方法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.1Name=Sublime Text 2GenericName=Text EditorExec=sublimeTerminal=falseIcon=/usr/lib/Sublime Text 2/Icon/48x48/sublime_text.pngType=ApplicationCategories=TextEditor;IDE;DevelopmentX-Ayatana-Desktop-Shortcuts=NewWindow[NewWindow Shortcut Group]Name=New WindowExec=sublime -nTargetEnvironment=Unity

参考配置2:

[Desktop Entry]Version=1.0Type=ApplicationName=Sublime TextGenericName=Text EditorComment=Sophisticated text editor for code, markup and proseExec=/opt/sublime_text/sublime_text %FIcon=sublime-textTerminal=falseMimeType=text/plain;Categories=TextEditor;Development;StartupNotify=trueActions=Window;Document;[Desktop Action Window]Name=New WindowExec=/opt/sublime_text/sublime_text -nOnlyShowIn=Unity;[Desktop Action Document]Name=New FileExec=/opt/sublime_text/sublime_text –command new_fileOnlyShowIn=Unity;

http://www.linuxidc.com/Linux/2013-01/77623.htm


Leave a Reply

Your email address will not be published. Required fields are marked *