Master Sublime Text: Essential Installation, Shortcuts, Plugins & Configuration
This comprehensive guide walks you through installing Sublime Text, adding it to the system path, setting up Package Control, mastering essential editing shortcuts, multi‑selection, find‑replace, navigation, window management, theming, and advanced JSON settings to boost your coding productivity.
Installation
Sublime Text 3 can be downloaded from the official website for Windows, macOS, and Linux. During the Windows installer, enable “Add to explorer context menu” to allow opening files directly from the file manager.
Adding Sublime Text to the System PATH (Windows)
Open the Run dialog ( Win+R) and type sysdm.cpl to launch System Properties. Switch to the Advanced tab, click Environment Variables , edit the Path variable and append the installation folder (e.g., D:\Program Files\Sublime Text 3). After confirming, the subl command can be used from any command prompt:
subl file # open a single file
subl folder # open a folder
subl . # open the current directoryPackage Control
Package Control is the de‑facto package manager for Sublime Text. Install it by opening the console ( Ctrl+`) and pasting the following one‑liner:
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 the installation finishes, press Ctrl+Shift+P and type “Package Control” to open the package browser.
Basic Concepts
Sublime Text’s UI consists of tabs, an editing area, a side bar (file/folder view), a minimap, a command palette, a console, and a status bar. All configuration is performed via JSON files rather than a graphical settings dialog.
Editing Shortcuts
Ctrl+Enter– insert a new line below the current line. Ctrl+Shift+Enter – insert a new line above the current line. Ctrl+←/→ – move cursor word‑wise; Ctrl+Shift+←/→ – select word‑wise. Ctrl+↑/↓ – scroll the view; Ctrl+Shift+↑/↓ – move the current line up or down. Ctrl+[ / Ctrl+] – decrease/increase indentation. Ctrl+Shift+V – paste with the current indentation level.
Multi‑Selection
Use Ctrl+D to select the next occurrence of the current word, Ctrl+K to skip a match, Ctrl+U to undo the last selection, and Esc to exit multi‑selection mode. Ctrl+Shift+L splits a multi‑line selection into separate cursors for simultaneous editing, while Ctrl+J joins the selected lines into a single line.
Find & Replace
Sublime Text provides three search modes:
Quick Find/Replace : select a word (e.g., with Ctrl+D), then press F3 / Shift+F3 to navigate forward/backward, or Alt+F3 to select all occurrences for simultaneous editing.
Standard Find/Replace : Ctrl+F opens the find panel, Ctrl+H opens replace. Options include Alt+C (case‑sensitive), Alt+W (whole word), and Alt+R (regex).
Multi‑File Search/Replace : Ctrl+Shift+F searches across files; the scope can be limited to specific folders or file patterns.
Navigation (Jumping)
Ctrl+P(“Go To Anything”) opens a fuzzy file selector. Additional prefixes allow precise jumps: @symbol – jump to a symbol in the current file. #keyword – jump to a bookmarked keyword. :12 – jump to line 12. Ctrl+R lists symbols in the current file, and Ctrl+G prompts for a line number.
Window & Tab Management
Ctrl+Shift+N– new window. Ctrl+N – new tab. Ctrl+W – close tab (or window if no tabs remain). Ctrl+Shift+T – reopen the last closed tab. Alt+Shift+2, Alt+Shift+8, Alt+Shift+5 – split screen horizontally, vertically, or into four panes. Ctrl+1…9 – focus a pane; Ctrl+Shift+1…9 – move the current file to a pane. F11 – toggle normal fullscreen; Shift+F11 – toggle distraction‑free fullscreen.
Themes & Color Schemes
Install third‑party themes via Package Control (e.g., Soda Light/Dark, Nexus, Flatland, Spacegray). Example JSON to set a theme and color scheme:
{
"theme": "Nexus.sublime-theme",
"color_scheme": "Packages/Theme - Flatland/Flatland Dark.tmTheme"
}Custom Settings (JSON)
Typical user preferences are stored in Preferences.sublime-settings as JSON. A common configuration might look like:
{
"font_face": "YaHei Consolas Hybrid",
"font_size": 12,
"caret_style": "phase",
"highlight_line": true,
"highlight_modified_tabs": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"rulers": [80, 100],
"draw_white_space": "all",
"trim_trailing_white_space_on_save": true,
"ensure_newline_at_eof_on_save": true,
"auto_find_in_selection": true
}Code Snippets & Auto‑Completion
Snippets expand with the Tab key. They can be installed from Package Control (e.g., HTML Snippets , Python Snippets ) or created manually by placing a .sublime-snippet file in the User package.
Additional Tools
Useful plugins include:
SublimeREPL – provides an interactive REPL console for Python, Ruby, etc.
BracketHighlighter – highlights matching brackets and tags.
HTMLBeautify – formats HTML code.
AutoPEP8 – automatically formats Python code according to PEP 8.
Alignment – aligns assignments, comments, and other delimiters.
Licensing Note
Sublime Text is a paid, closed‑source editor. An unlimited evaluation period is available, but continued use requires a license purchase.
Further Resources
Official documentation: http://www.sublimetext.com/docs/3/
Package Control repository: https://sublime.wbond.net/
Community forums and Stack Overflow tags for troubleshooting.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
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.
