Terminal GuideTerminal Guide
sublime-text icon

Sublime Text

Text Editors
macOSLinuxWindows
C++/Python

Fast and sophisticated text editor with powerful features.

Official Website

Features

FastMultiple CursorsCommand PalettePackage ManagerDistraction Free Mode

Installation

Homebrew
brew install --cask sublime-text
APT (Debian/Ubuntu)
apt install sublime-text
Pacman (Arch)
pacman -S sublime-text
Chocolatey
choco install sublimetext4

Why Use Sublime Text?

Sublime Text is a fast and sophisticated text editor that has been under development since 2008. As a pioneer of multi-cursor editing and command palette, it had a major influence on later editors.

Lightning Fast

Instant startup as a native application. Opens large files with ease.

Multi-Cursor

Edit multiple locations simultaneously. Powerful editing with select all instances, rectangular selection, etc.

Command Palette

Access almost all features from keyboard. The original command palette pioneer.

Package Control

Rich package ecosystem. Easy installation of language support, themes, and feature extensions.

Installation

Installation
# macOS (Homebrew)
brew install --cask sublime-text

# macOS (from official website)
# https://www.sublimetext.com/download

# Ubuntu/Debian
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/sublimehq-archive.gpg > /dev/null
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt update
sudo apt install sublime-text

# Fedora
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

# Arch Linux
sudo pacman -S sublime-text-4

# Windows (Chocolatey)
choco install sublimetext4

# Windows (Scoop)
scoop install sublime-text

# Enable CLI tool (macOS)
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl

Basic Operations

CLI Operations
# Open a file
subl filename.txt

# Open directory (project)
subl .
subl ~/projects/myapp

# Open multiple files
subl file1.txt file2.txt

# Open in new window
subl -n filename.txt

# Add to existing window
subl -a filename.txt

# Jump to specific line
subl filename.txt:10

# Wait mode (wait until file is closed)
subl -w filename.txt

# Compare diff
subl --compare file1.txt file2.txt

Common Keyboard Shortcuts

File Navigation

Key (macOS)Key (Windows/Linux)Description
Cmd+PCtrl+PGoto Anything (file/symbol search)
Cmd+Shift+PCtrl+Shift+PCommand Palette
Cmd+RCtrl+RGo to symbol (@)
Cmd+GCtrl+GGo to line (:)
Cmd+K, Cmd+BCtrl+K, Ctrl+BToggle sidebar
Cmd+`Ctrl+`Open console

Multi-Cursor & Selection

Key (macOS)Key (Windows/Linux)Description
Cmd+DCtrl+DAdd next word to selection
Cmd+Ctrl+GAlt+F3Select all matching words
Cmd+LCtrl+LSelect line (expand on repeat)
Cmd+Shift+LCtrl+Shift+LSplit selection to lines (cursor at end)
Cmd+ClickCtrl+ClickAdd cursor
Ctrl+Shift+Up/DownCtrl+Alt+Up/DownAdd cursor above/below
Cmd+Shift+SpaceCtrl+Shift+SpaceExpand scope selection

Editing

Key (macOS)Key (Windows/Linux)Description
Cmd+Shift+DCtrl+Shift+DDuplicate line
Cmd+Shift+KCtrl+Shift+KDelete line
Cmd+JCtrl+JJoin line
Cmd+/Ctrl+/Toggle comment
Cmd+Ctrl+Up/DownCtrl+Shift+Up/DownMove line up/down
Cmd+] / Cmd+[Ctrl+] / Ctrl+[Indent / Unindent
Cmd+EnterCtrl+EnterInsert new line below
Cmd+Shift+EnterCtrl+Shift+EnterInsert new line above

Search & Replace

Key (macOS)Key (Windows/Linux)Description
Cmd+FCtrl+FFind
Cmd+HCtrl+HReplace
Cmd+Shift+FCtrl+Shift+FFind in project
Cmd+ECtrl+EUse selection for find

Package Control

Package Control is a package manager for Sublime Text. Thousands of packages are available.

Installing Package Control

Install Package Control
# Install from console
1. Open console with Ctrl+` (or Cmd+`)
2. Paste the code below and press Enter

import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; 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://packagecontrol.io/' + 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)

# Restart Sublime Text after installation

Managing Packages

Package Management
# Install package
1. Open command palette with Cmd+Shift+P (or Ctrl+Shift+P)
2. Type "Package Control: Install Package"
3. Search for package name and press Enter

# Remove package
1. Open command palette
2. Type "Package Control: Remove Package"
3. Select package to remove

# Update packages
"Package Control: Upgrade Package" or
"Package Control: Upgrade/Overwrite All Packages"

# Popular packages
- Emmet              : HTML/CSS expansion
- SublimeLinter      : Linter framework
- LSP                : Language Server Protocol
- A File Icon        : Sidebar icons
- Material Theme     : Material Design theme
- GitGutter          : Git diff display
- BracketHighlighter : Bracket highlighting
- Terminus           : Integrated terminal
- SideBarEnhancements: Sidebar extensions
- All Autocomplete   : Completion from all files

Configuration File

Sublime Text settings are written in JSON. Open with Preferences > Settings.

Preferences.sublime-settings
{
  // Font
  "font_face": "JetBrains Mono",
  "font_size": 14,

  // Color scheme
  "color_scheme": "Packages/Color Scheme - Default/Monokai.sublime-color-scheme",
  "theme": "Default Dark.sublime-theme",

  // Tab settings
  "tab_size": 2,
  "translate_tabs_to_spaces": true,
  "detect_indentation": true,

  // Line numbers
  "line_numbers": true,
  "relative_line_numbers": false,

  // Minimap
  "draw_minimap_border": true,
  "always_show_minimap_viewport": true,

  // Cursor
  "caret_style": "smooth",
  "caret_extra_width": 2,

  // Word wrap
  "word_wrap": false,
  "wrap_width": 120,

  // Whitespace
  "draw_white_space": ["selection"],
  "trim_trailing_white_space_on_save": true,
  "ensure_newline_at_eof_on_save": true,

  // Sidebar
  "show_definitions": true,
  "preview_on_click": true,

  // Auto save
  "save_on_focus_lost": true,

  // Auto pair
  "auto_match_enabled": true,

  // Scroll
  "scroll_past_end": true,
  "scroll_speed": 5.0,

  // Format
  "default_line_ending": "unix",

  // Exclude files
  "folder_exclude_patterns": [
    ".git",
    "node_modules",
    "__pycache__",
    ".cache"
  ],
  "file_exclude_patterns": [
    "*.pyc",
    ".DS_Store",
    "*.lock"
  ],

  // Highlighting
  "highlight_line": true,
  "highlight_modified_tabs": true,

  // Indent guide
  "indent_guide_options": ["draw_active"],

  // Auto complete
  "auto_complete_delay": 50,
  "auto_complete_commit_on_tab": true
}

Keymap Configuration

Customize keymaps with Preferences > Key Bindings.

Default.sublime-keymap
[
  // Save
  { "keys": ["ctrl+s"], "command": "save" },

  // Duplicate line (VS Code style)
  { "keys": ["ctrl+shift+d"], "command": "duplicate_line" },

  // Move line up/down
  { "keys": ["alt+up"], "command": "swap_line_up" },
  { "keys": ["alt+down"], "command": "swap_line_down" },

  // Multi-cursor
  { "keys": ["ctrl+alt+up"], "command": "select_lines", "args": {"forward": false} },
  { "keys": ["ctrl+alt+down"], "command": "select_lines", "args": {"forward": true} },

  // Toggle sidebar
  { "keys": ["ctrl+b"], "command": "toggle_side_bar" },

  // Terminal (with Terminus package)
  { "keys": ["ctrl+`"], "command": "toggle_terminus_panel" },

  // Go to definition
  { "keys": ["f12"], "command": "goto_definition" },
  { "keys": ["ctrl+click"], "command": "goto_definition" },

  // Jump back
  { "keys": ["ctrl+-"], "command": "jump_back" },
  { "keys": ["ctrl+shift+-"], "command": "jump_forward" }
]

Vintage Mode (Vim Keybindings)

Sublime Text has built-in Vintage Mode providing Vim keybindings.

Vintage Mode Settings
# Enable Vintage Mode
# Add to Preferences.sublime-settings

{
  // Remove Vintage from ignored_packages
  "ignored_packages": [
    // Remove "Vintage"
  ],

  // Start Vintage mode in command mode
  "vintage_start_in_command_mode": true,

  // Ctrl+[ acts like Escape
  "vintage_ctrl_keys": true
}

# For more powerful Vim emulation
# Install NeoVintageous package
# Package Control: Install Package → NeoVintageous

LSP (Language Server Protocol)

Installing the LSP package provides language support similar to VS Code.

LSP Configuration
# Install LSP package
1. Package Control: Install Package
2. Search and install "LSP"

# Install language servers
# TypeScript/JavaScript
Package Control: Install Package → LSP-typescript

# Python
Package Control: Install Package → LSP-pyright
# or
pip install python-lsp-server

# Rust
Package Control: Install Package → LSP-rust-analyzer

# Go
Package Control: Install Package → LSP-gopls

# LSP Configuration
# Preferences > Package Settings > LSP > Settings
{
  "show_diagnostics_panel_on_save": 0,
  "lsp_format_on_save": true,
  "clients": {
    "pyright": {
      "enabled": true
    },
    "typescript-language-server": {
      "enabled": true
    }
  }
}

# LSP Commands
- LSP: Goto Definition
- LSP: Find References
- LSP: Rename
- LSP: Code Action
- LSP: Format Document

Tips

  • Use Cmd+P for Goto Anything. @ for symbols, : for lines, # for word search.
  • Use Cmd+D to select matching words sequentially. Cmd+K, Cmd+D to skip.
  • Rectangular selection with Option+drag (macOS) or Shift+right-click.
  • Use Cmd+Shift+L to place cursors at end of each selected line. Great for batch editing.
  • Create project files (.sublime-project) for project-specific settings.
  • Sublime Text is free to try but license purchase is recommended for continued use.
  • Enter focus mode with Distraction Free Mode (Cmd+Ctrl+Shift+F).
Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More