Comprehensive Guide to Sublime Text: Installation, Configuration, and Usage
This article provides a thorough, step‑by‑step tutorial on Sublime Text covering its history, installation on Windows, environment‑variable setup, Package Control installation, core concepts, settings, editing features, multi‑selection, find/replace, navigation shortcuts, window management, themes, color schemes, good coding practices, and a complete shortcuts cheat‑sheet.
This guide systematically introduces Sublime Text, aiming to become the best Chinese tutorial for the cross‑platform code editor.
Prologue : The author, a typical programmer working mainly on Linux with Java, Python, HTML/CSS/JavaScript, and occasional C# on Windows, explains why Sublime Text is a preferred editor alongside Vim.
Editor Choices : Highlights Sublime Text’s cross‑platform nature, extensibility via plugins, and complementary use with Vim for CLI and GUI workflows.
Installation : Provides Windows installation steps, reminding users to check “Add to explorer context menu”.
Adding Sublime Text to PATH :
sysdm.cplThen edit the Path variable to include the installation directory (e.g., D:\Program Files\Sublime Text 3 ).
Command line usage:
subl file :: Open file with Sublime Text
subl folder :: Open folder with Sublime Text
subl . :: Open current folderPackage Control : Install via the console with the following script:
import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)After installation, use Ctrl+Shift+P to access Package Control commands.
Basic Concepts : Describes UI elements such as tabs, editing area, side bar, minimap, command palette, console, and status bar.
Settings : Sublime Text uses JSON configuration files. Example:
{
"font_size": 12,
"highlight_line": true,
}Additional user settings include font face, caret style, tab size, and whitespace handling.
Editing : Highlights human‑friendly shortcuts (e.g., Ctrl+Enter to add a line below, Ctrl+Shift+Enter to add above, word navigation with Ctrl+←/→ , etc.).
Selection : Multi‑selection with Ctrl+D , splitting selections with Ctrl+Shift+L , merging with Ctrl+J , and bracket navigation with Ctrl+M and Ctrl+Shift+M .
Finding & Replacing : Covers quick find/replace, standard find/replace ( Ctrl+F , Ctrl+H ), keyword find/replace, regex mode ( Alt+R ), and multi‑file search ( Ctrl+Shift+F ).
Jumping : File navigation with Ctrl+P , symbol navigation with Ctrl+R , line navigation with Ctrl+G , and combined jumps using @ , # , and : prefixes.
Windows & Tabs : New window ( Ctrl+Shift+N ), new tab ( Ctrl+N ), close tab/window ( Ctrl+W ), restore tab ( Ctrl+Shift+T ), and split screen shortcuts ( Alt+Shift+2 , Alt+Shift+8 , Alt+Shift+5 ).
Full Screen : Toggle normal full screen with F11 and distraction‑free mode with Shift+F11 .
Styles & Themes : Discusses default dark theme (Monokai Bright) and recommends third‑party themes such as Soda Light/Dark, Nexus, Flatland, Spacegray Light/Dark. Theme configuration example:
"theme": "Nexus.sublime-theme",
"color_scheme": "Packages/Theme - Flatland/Flatland Dark.tmTheme",Good Practices : Shows settings for tab size, spaces, rulers, whitespace visibility, and automatic newline handling.
Code Snippets & Formatting : Explains snippet insertion with Tab , and formatting tools like HTMLBeautify, AutoPEP8, and Alignment.
Auto Completion & Brackets : Tab‑based completion and bracket navigation shortcuts.
Command Line : Uses SublimeREPL for interactive sessions.
Miscellaneous : Mentions macros, project management, Vintage (Vim mode), build systems, and debugging plugins.
Shortcuts Cheat‑Sheet : Provides a comprehensive list of shortcuts grouped by category (General, Editing, Selecting, Finding & Replacing, Jumping, Window, Screen).
Author: lucida – Original article
Architect's Tech Stack
Java backend, microservices, distributed systems, containerized programming, and more.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.