Choose your operating system:
On macOS, download Sublime Text 4 from its download page. All versions of OS X/macOS from Mavericks 10.9 onwards are supported.
By default, Sublime Text will search for updates each time you open it (or you can force a search via the menu: Sublime Text > Check for Updates…). If one is available, you should get a prompt inviting you to download it. Click “Download”, then click “Install”. The programme should restart and show you a changelog on its own.
You can open files in Sublime Text from a Finder window, but it’s often useful to be able to do this from within a terminal as well:
subl --version
Sublime Text Build 4152
) or it might not and return an
error message (zsh: command not found: subl
). If it’s the
former then you’re done, but if it’s the latter then it means you need
to add the Sublime Text path to your PATH
variable:
/etc/paths
in an editor with sudo permissions,
eg:sudo nano /etc/paths
/Applications/Sublime Text.app/Contents/SharedSupport/bin
subl --version
*In older versions of macOS (and older versions of Sublime Text) the
command is sublime
, not subl
You can now open a file in Sublime Text from the terminal with:
subl <filename>
In order to be able to open a file in Sublime Text by double-clicking it you need to make Sublime Text the default editor for its file type. To do this, right-click a file in Finder > Get Info > under “Open with:” find “Sublime Text” in the dropdown menu > click “Change All…” > Continue.
On macOS Sierra the default behaviour is for a full stop to be added when the space bar is pressed twice. This is a Sierra thing, not a Sublime Text thing. It can be disabled by going to System Preferences > Keyboard > Text > deselect “Add period with double-space” on the right.
Open New Files in the Existing Window
If the default behaviour is for Sublime Text to open files in new windows as opposed to the existing windows you have open, you can change this as follows:
// New files should open as tabs in the currently-open windows
"open_files_in_new_window": false
// New files should open as tabs in the currently-open windows
"open_files_in_new_window": false,
Ruler
For programming languages such as Python, it’s good practice to have a maximum of 79 characters per line. Sublime Text allows you to put a ‘ruler’ at a distance of 80 characters away from the left-hand margin to help you stick to this convention while you code, but it gets turned off each time you close out. To make it permanent, open up the user Preferences as described above and add the following (again, with an appending comma if and only if other preferences follow this one):
// Set vertical ruler(s) in specified columns
"rulers": [80],
/Users/<username>/Library/Application Support/Sublime Text 4/Packages/User/Preferences.sublime-settings
"added_words"
section in the JSON User
Settings file on the right-hand-side, for example:{
"added_words":
[
"covid",
"furloughed",
"lockdown"
]
}
The easiest way is to go to the Sublime Text downloads
page, click “direct downloads” next to “Linux repos” (don’t click
“Linux repos” itself) and download the “64 bit .deb” version. This can
then be installed from the terminal using dpkg -i
(which
works for most .deb files):
cd Downloads
sudo dpkg -i sublime-text_build-4143_amd64.deb
Replace sublime-text_build-4143_amd64.deb
with the file
name of the version you downloaded. You’ll be prompted to enter your
computer’s password before the installation starts.
This method is, in my opinion, better than the other options:
Sublime Text checks for updates automatically and, if one is available, it will prompt you to update when you open the programme. When this happens, click “Download” (which will take you to the “Download” page on the website) and then follow the same process as for installing:
cd Downloads
sudo dpkg -i sublime-text_build-4143_amd64.deb
As before, replace sublime-text_build-4143_amd64.deb
with the file name of the version you downloaded and you’ll be prompted
to enter your computer’s password before the installation starts. You
can check that it has worked by running subl --version
which should return the programme name and build number.
You can open a file in Sublime Text from the terminal with:
subl <filename>
It can also be done by right-clicking on a file > Open With Other Application > Sublime Text.
In order to be able to open a file in Sublime Text by double-clicking it you need to make Sublime Text the default editor for its file type. To do this, right-click a file in Files > Properties (Ctrl+I is the keyboard shortcut) > Open With > find “Sublime Text” in the menu and click “Set as default”.
Ruler
For programming languages such as Python, it’s good practice to have a maximum of 79 characters per line. Sublime Text allows you to put a ‘ruler’ at a distance of 80 characters away from the left-hand margin to help you stick to this convention while you code, but it gets turned off each time you close out. Here’s how to make it permanent:
// Set vertical ruler(s) in specified columns
"rulers": [80]
// Set vertical ruler(s) in specified columns
"rulers": [80],
~/.config/sublime-text/Packages/User/Preferences.sublime-settings
"added_words"
section in the JSON User
Settings file on the right-hand-side, for example:{
"added_words":
[
"covid",
"furloughed",
"lockdown"
]
}
subl --version
from the terminal; it should return a build number.wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text
subl <filename>
~/.config/sublime-text/Packages/User/Preferences.sublime-settings
"added_words"
section in the JSON User
Settings file on the right-hand-side, for example:{
"added_words":
[
"covid",
"furloughed",
"lockdown"
]
}
subl --version
from the terminal; it should return a build number.subl <filename>
"open_files_in_new_window": false
cd /
sudo find . -name "sublime_text.desktop"
./snap/sublime-test/24/opt/sublime_text/sublime_text.desktop
subl /usr/share/applications/defaults.list
~/.config/sublime-text/Packages/User/Preferences.sublime-settings
"added_words"
section in the JSON User
Settings file on the right-hand-side, for example:{
"added_words":
[
"covid",
"furloughed",
"lockdown"
]
}
Install from the terminal with:
sudo add-apt-repository ppa:webupd8team/sublime-text-4
sudo apt-get update
sudo apt-get install sublime-text-installer
You can open a file in Sublime Text from the terminal with:
subl <filename>
You can also right-click on a file > Open With > Sublime Text. If you try this and Sublime Text is not in the ‘Open With’ list, do the following:
/usr/share/applications/sublime_text.desktop
and paste them
in here:
~/.local/share/applications/sublime_text.desktop
sudo update-desktop-database
In order to be able to open a file in Sublime Text by double-clicking it you need to make Sublime Text the default editor for its file type. To do this, right-click a file in Files > Properties (Ctrl+I is the keyboard shortcut) > Open With > find “Sublime Text” in the menu and click “Set as default”.
If the default behaviour is to open new files in a new window, you can change this so that they open in the same window:
"open_files_in_new_window": false
To make Sublime Text the default editor:
sudo add-apt-repository ppa:trebelnik-stefina/ubuntu-tweak
sudo apt update
sudo apt install ubuntu-tweak
~/.config/sublime-text/Packages/User/Preferences.sublime-settings
"added_words"
section in the JSON User
Settings file on the right-hand-side, for example:{
"added_words":
[
"covid",
"furloughed",
"lockdown"
]
}
On Fedora 22, install Sublime Text from the terminal with:
sudo rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg
sudo dnf config-manager --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo
sudo dnf install sublime-text
Open a file in Sublime Text from the terminal with:
subl <filename>
To make Sublime Text the default editor, right-click on a file > Properties > Open With > select “Sublime Text” > Set as default
To insert Unicode characters:
On Windows 7, 8 and 10, install Sublime Text from its download page.
You can open a file in Sublime Text from the command prompt with:
subl.exe <filename>
If this doesn’t work, it’s probably because Sublime Text is not added to your PATH:
sysdm.cpl
from Command
Prompt)SUBLIME
C:\Program Files\Sublime Text 4
;%SUBLIME%
To make Sublime Text the default editor, right-click on a file > Open with > choose default program