Skip to content

Instantly share code, notes, and snippets.

@YoussefKababe
Forked from simonewebdesign/install_sublime_text.sh
Last active August 29, 2015 14:17
Show Gist options
  • Save YoussefKababe/0e5c5fb083b79acad558 to your computer and use it in GitHub Desktop.
Save YoussefKababe/0e5c5fb083b79acad558 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Sublime Text 3 install with Package Control (last update: 24 March 2015)
#
# Run this script with:
#
# curl -L git.io/sublimetext | sh
# Detect the architecture
if [ "$(uname -m)" = "x86_64" ]; then
ARCHITECTURE="x64"
else
ARCHITECTURE="x32"
fi
# Download the tarball, unpack and install
URL="http://c758482.r82.cf2.rackcdn.com/sublime_text_3_build_3083_$ARCHITECTURE.tar.bz2"
INSTALLATION_DIR="/opt/sublime_text"
curl -o $HOME/st3.tar.bz2 $URL
if tar -xf $HOME/st3.tar.bz2 --directory=$HOME; then
# Remove the installation folder and the symlink, they might already exist
sudo rm -rf $INSTALLATION_DIR /bin/subl
sudo mv $HOME/sublime_text_3 $INSTALLATION_DIR
sudo ln -s $INSTALLATION_DIR/sublime_text /bin/subl
fi
rm $HOME/st3.tar.bz2
# Package Control - The Sublime Text Package Manager: https://sublime.wbond.net
curl -o $HOME/Package\ Control.sublime-package https://sublime.wbond.net/Package%20Control.sublime-package
sudo mv $HOME/Package\ Control.sublime-package "$INSTALLATION_DIR/Packages/"
# Add to applications list (thanks 4ndrej)
sudo ln -s $INSTALLATION_DIR/sublime_text.desktop /usr/share/applications/sublime_text.desktop
echo ""
echo "Sublime Text 3 installed successfully!"
echo "Run with: subl"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment