Catalog / Sublime Text Cheatsheet

Sublime Text Cheatsheet

A comprehensive cheat sheet for Sublime Text, covering essential shortcuts, commands, and features to boost your coding efficiency.

Selection & Navigation

Basic Selection

⌘ D

Select current word (repeat to include next instance of word).

⌘ L

Select current line (repeat to include next line).

⌘ ⇧ L

Split selection into multiple lines.

⌘ A

Select all text in the current file.

Ctrl + Shift + Space

Select the current scope (inside brackets, parentheses, etc.).

Alt + F3

Select all occurrences of the current selection.

Advanced Selection

⌘ ⇧ A

Select text inside tag (repeat to expand).

Ctrl ⇧ M

Select to curly or angle brackets (repeat to expand).

⌘ K ⌘ B

Toggle the sidebar visibility.

Ctrl + Click

Multi-select: Add another caret for multiple selections.

Ctrl + Alt + Up/Down

Column selection: Select text in a column.

Ctrl + Shift + Up/Down

Extend selection to the line above/below.

Navigation

⌘ P

Go to anything.

⌘ G

Go to line number.

⌘ R

Go to symbol.

⌘ ⇧ P

Show Command Palette: Access all Sublime Text commands.

⌘ T

Go to file (fuzzy search).

Alt + .

Close current tag (HTML/XML).

Editing & Code Folding

Basic Editing

⌘ ⇧ D

Duplicate current line/selection.

⌘ ⇧ K

Delete current line/selection.

⇧ del

Delete current line/selection.

⌘ ⇧ ↑

Move line up.

⌘ ⇧ ↓

Move line down.

⌘ J

Join lines.

Advanced Editing

⌘ /

Toggle comment on current line/selection.

⌘ ⇧ V

Paste and indent.

⌘ K ⌘ U

Convert selection to uppercase.

⌘ K ⌘ L

Convert selection to lowercase.

Ctrl + Space

Autocompletion.

Ctrl + Shift + V

Paste from history.

Code Folding

⌘ Alt [

Fold closest block.

⌘ Alt ]

Unfold closest block.

⌘ K ⌘ 1

Fold all first level code blocks.

⌘ K ⌘ 2

Fold all second level code blocks.

⌘ K ⌘ 3 (etc)

Fold all third level code blocks (etc).

⌘ K ⌘ 0

Unfold everything.

Find & Replace

Find

⌘ F

Find.

⌘ ⇧ F

Find in files.

F3

Find next.

⇧ F3

Find previous.

⌘ E

Use selection for find.

Ctrl + H

Incremental find: Find as you type.

Replace

⌘ Alt F

Replace.

⌘ ⇧ Alt F

Replace in files.

Alt + Enter

Select all matches for replacement.

⌘ ⇧ E

Use selection for replace.

⌘ Alt ⇧ F

Replace all.

⌘ Alt E

Edit the next find/replace.

Find Options

Case Sensitive: Match only if the case matches.

Whole Word: Match only entire words.

Wrap: Continue searching from the beginning of the file.

In Selection: Limit search to the current selection.

Highlight Matches: Highlight all matching occurrences.

Regular Expression: Use regular expressions for more complex searches.

View & Command Line

View

⌘ ⇧ N

New window.

⌘ W

Close current tab.

⌘ ⇧ T

Reopen last closed tab.

⌘ Alt ⇧ P

Switch project.

Ctrl + Tab

Switch tabs.

⌘ ⇧ W

Close window.

Command Line Usage

subl . - Open current directory in Sublime Text.

subl README.md - Open README.md file in Sublime Text.

subl <file1> <file2> - Open multiple files in Sublime Text.

subl -n - Open a new Sublime Text window.

subl -b - Open files in background.

subl --project <project_file> - Open Sublime Text with a specific project file.

Settings and Preferences

Preferences > Settings - User: Customize Sublime Text settings.

Preferences > Package Settings: Configure installed packages.

Preferences > Key Bindings - User: Customize key bindings.

Preferences > Color Scheme: Change the color scheme.

View > Syntax: Change the syntax highlighting.

View > Layout: Change the layout of the editor (single, columns, grid).