Learn How to Use Sublime Text: A Quick Overview

Learn How to Use Sublime Text: A Quick Overview

·

7 min read

Sublime Text is jam-packed with powerful features like multi-line editing, build systems for dozens of programming languages, regex find and replace, a Python API for developing plugins, and more.

Best of all, it’s cross-platform (Mac, Windows, and Linux), and it’s distributed as “shareware,” which means it’s free to use with the occasional purchase pop-up.

Keep reading to learn how to use Sublime Text to fulfill all your text and code editing needs!

Sublime Text 101 – The Basics

Since Sublime Text is such a jam-packed app in terms of functionality, we’ll discuss essential features and workflows for two subsets of users – writers and developers. But first, let’s establish a core understanding of Sublime Text before branching off into user-specific items.

How to Customize Sublime Text Settings

Unlike other apps with graphical settings menus, the Sublime Text settings are entirely text-based. To view your Sublime Text settings, go to Sublime Text > Preferences, and click Settings. You should then see a document like this:

Settings for Sublime Text

This settings document may look daunting at first (especially if you’re not used to working with developer-oriented tools), but we’ll help you make sense of everything now!

Sublime Text’s settings are stored in JSON format. JSON is an industry-standard format for storing key-value information, so you may have seen it used somewhere else before. JSON stores information into key-value arrays like so:

{
“color”: “blue”,
“type”: “sedan”,
“seats”: 5,
}

The array above can be used to describe the properties of a car – in this case, a blue sedan with five seats. Similarly, a JSON array can specify settings for an application, which is precisely what Sublime Text does.

Let’s get back to the Sublime Text settings file. As you can see in the screenshot above, the settings file is presented as two JSON arrays. The array on the left contains Sublime Text’s default settings, while the one on the right includes custom user settings.

In general, you should never change the default settings directly. Instead, you can override default settings with custom settings – this allows you to revert to the default settings if something goes wrong.

So, how would you go about changing a few default settings? Let’s say you want to make the changes below:

"font_size": 10 to "font_size": 20
"margin": 4 to "margin": 6
"line_numbers": true to "line_numbers": false

To make these changes, add each element to the custom user settings document in valid JSON format like so (if you have existing custom settings, add each setting without creating a new array):

{
"font_size": 20,
"margin": 6,
"line_numbers": false,
}

If you’re unsure whether you formatted the settings correctly, you can use an online tool like JSONLint to validate your JSON array. After you’ve specified the settings, save the file, and you’re all set!

Project and File Management in Sublime Text

When working on a project, whether a series of blog posts or source code for a web application, it’s common for your files to be organized within a project folder. Sublime Text considers and provides a functional graphical interface for managing files and directories.

Let’s say you have a folder named “my-sublime-text-project” like the one in the screenshot below. If you drag and drop this folder into Sublime Text, you’ll be able to create new files and folders directly within Sublime Text.

Sublime Text project folder

As you can see, the “my-sublime-text-project” folder can be seen on the left-hand side of the Sublime Text window under “Folders.”

File and folder management

Right-clicking on the project folder brings up a sub-menu that lets you create new files, rename files, create and delete folders, and more. Sublime Text’s built-in file management features removes the need for an external tool like Finder to perform basic file management tasks.

Create files and folders

In Sublime Text, a project refers to a collection of imported files and folders (e.g. the “my-sublime-text-project” folder we imported earlier. If you click Project in the menu bar, you’ll see there are options such as “Open Project,” “Switch Project,” and “Save Project As.” However, there is no option to create a new project.

This is because Sublime Text projects are implicitly created when you create a new file and import a folder. In the example above, we can click Project in the menu bar and click Save Project As to save the project.

Sublime Text for Writers

Highlight File Management

Highlight how the file management and project management feature can organize content. For example, an author could create a file for each chapter in a book, while a blogger could create different folders for different categories of posts.

Powerful Search Engine and Replace

Sublime Text has a powerful search and replace implementation. Not only does it support regex, but you can also specify files and folders to search through. For example, if an author wanted to change the name of a character in a story, they could specify the search folder and run the search on all the contents of the folder.

Very Extensible

Sublime Text is extensible, and its MarkdownEditing package is a great tool for writers who use Markdown syntax.

Sublime Text for Developers

Rich Plugin Ecosystem

Sublime Text has a rich plugin ecosystem that can be accessed via the built-in package manager. Developers can install plugins to improve their workflow. For example, the Formatter plugin includes formatting rules for HTML, CSS, JS, Python, and other languages.

The plugin can be configured to automatically format source code files, which helps to keep code neat and standardized in terms of formatting.

A couple more must-have plugins to consider include Package Control (needed for installing plugins) and Emmet.

Multi-Line Editing

Sublime Text offers multi-line editing, which can be accessed by holding down Command on Mac (Ctrl on Windows) and using the mouse to select multiple lines. After multiple lines are selected, you can edit all lines at once, and multi-line copy/paste is even supported.

Split Window Support

Sublime Text supports split windows to view and edit multiple files simultaneously. This can be useful when referring to a different file while working on a project.

Support For Build Systems

Sublime Text ships with support for build systems. Build systems let you run code directly in the Sublime Text editor’s terminal without the need for an external terminal.

For example, you could create a build system to run a Python program and another build system to run a Go program. When developing an application, you can select a build system and use a shortcut to run the program directly from Sublime Text.

More Customizability With Themes

You can enhance your coding experience even more by downloading a Sublime Text theme. Most of them come bundled with a variety of color schemes already.

The difference between themes and color schemes for Sublime Text is that a theme decorates the core UI elements, like side-pane, tabs, menus, and more, while color schemes are responsible for syntax-highlighting.

Some of the best themes to check out include:

Summary

Sublime Text is one of the most popular code editors out there today. Rightfully so, it provides both writers and developers with a ton of tools to use.

There’s nothing more satisfying than finding the perfect code editor. If you have never tried Sublime Text, it is worth a look.

Are you currently using Sublime Text? Do you prefer it over other code editors? Let us know in the comment s below.


Get all your applications, databases, and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:

  • Easy setup and management in the MyKinsta dashboard

  • 24/7 expert support

  • The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability

  • An enterprise-level Cloudflare integration for speed and security

  • Global audience reach with up to 35 data centers and 275 PoPs worldwide

Get started with a free trial of our Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.