It’s no secret that Ubuntu is a great operating system for software development. While programmers have ample choices as to what code editor or IDE to use, one of the most beloved ones is Sublime Text.
In this tutorial we will learn how to install Sublime Text on our Ubuntu Desktop computer.
Table of Contents
What is Sublime Text?
Sublime Text is a text editor for writing code in almost any file format. It is specially designed to write without distractions. In other words, it visually offers a dark environment where the lines of code you write will stand out so you can focus exclusively on them.
While we will be installing Sublime Text in this tutorial, it’s good to know that Sublime Text is cross-platform, available for Linux, Windows and macOS. Sublime Text is not free and is not open source, the current price for a license is $99 USD. A single license can be used among all your machines even on multiple platforms. Sublime Text can also be used in evaluation mode for as long as you like.
Installing Sublime Text on Ubuntu
Installation of Sublime Text has to be done on the command line. Let’s open our Terminal and run the following command:
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
Here we are using the wget utility to to download the public signing key from Sublime Text’s website. After it’s downloaded we are using the apt-key utility to add it to the apt keyring.
Apt is the official repository of Canonical, the company behind the Ubuntu OS. A repository is akin to an app store where we can download applications from, onto our Ubuntu computer.
In this scenario Sublime Text is not an application hosted on Ubuntu’s repository so that’s why we are downloading a public encryption key from Sublime Text to be able to download and verify the authenticity of the app.
After we have run the command above, we will get a warning that apt-key is deprecated, for now we can ignore that message as it’s deprecated but it’s still functioning on Ubuntu 22.04.
Then we will proceed with the following command:
sudo apt-get install apt-transport-https
This command will install a component for apt to be able to download from an https protocol source.
Then we proceed with the following command:
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
This command adds Sublime Text’s repository to our apt repository list. After performing this command we will be able to download, install and update from this new repository including it in the sudo apt update and sudo apt upgrade source’s list.
After that is done, we simply run the command to refresh the apt cache.
sudo apt update
Then finally we install Sublime Text with the following command:
sudo apt install sublime-text
After we have installed Sublime Text on the command line we should be able to find it with the application launcher of Ubuntu.
We open the app launcher and search for Sublime Text.
And we are done installing Sublime Text on Ubuntu.
Features of Sublime Text
Now that we have Sublime Text installed on our computer let’s learn a little bit of what it can do.
Code Editor
At it’s core Sublime Text is a code editor. It has a clean and simple interface that does not display toolbars and configuration dialogs. However, this does not mean that it lacks functions as it has plugins, autocomplete functions, among others. Its interface is divided into tabs, this means that you can have open as many files as you want.
Side Panel
It has an intuitive side panel that let’s you see the the directory tree structure of the files you’re editing. This side panel makes it very easy to know exactly which section of your project you’re working in.
Syntax Highlighting
Based on the language of the code that you’re writing Sublime Text can automatically color syntax highlight your code. Sublime Text syntax highlight based on the extension of the file you’re editing or manually through the menus. This feature is incredibly useful when you’re a developer.
It is compatible with all of these languages:
Bash, C, C++, C#, CSS, D, Erlang, HTML, Groovy, Haskell, HTML, Java, JavaScript, LaTeX, Lisp, Lua, Markdown, Matlab, OCaml, Perl, PHP, Python, R, Ruby, SQL, TCL, Textile and XML
Auto Complete
Its auto complete feature makes programming easier and faster. It offers you a list of possible words as you are typing according to words that you have used previously. It’s a shortcut that cuts down from having to type repetitive words.
Conclusion
Sublime Text is a darling of the developer community. It’s accessible to anyone for download even though it needs a license. It’s not restricted and works on the honor system, a system that developers respect and gladly pay for it.
And they do so because it is one of the most minimalist yet powerful tool in the software developer’s arsenal in crafting and working on development code. Check out Sublime Text for yourself, you’ll be glad you did.