What & How & Why

这是本文档旧的修订版!


Install Sublime Text 3 to CentOS 7

The install method is using source tarball on CentOS 7.



Download & unpack

The latest stable version can be downloaded from Sublime Text website or you can use the following “wget” command to download the tar-file that suits you better and extract it as shown below.

# wget http://c758482.r82.cf2.rackcdn.com/sublime_text_3_build_3083_x64.tar.bz2
# tar -vxjf sublime_text_3_build_3083_x64.tar.bz2

Change directory

Once unpacked, you will get a directory called “Sublime_Text_3″. I moved them to the /opt directory.

# sudo mv Sublime_Text_3 /opt/

Next create a symbolic link to call “Sublime Text” from the command line as “sublime”. To do, create a symbolic link under “/usr/bin” as shown below.

# sudo ln -s /opt/Sublime_Text_3/sublime_text /usr/bin/sublime

Create Unity Lancher

If you are using Unity and want to add “Sublime Text” to the Unity launcher. Create a “sublime.desktop” file under “/usr/share/applications”.

sudo sublime /usr/share/applications/sublime.desktop

Then Copy and Paste the following content into it. Save and close.
[Desktop Entry]
Version=2.0.1
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

Then you can find your desktop icon at Applications→Programming.