Sublime Text Cheatsheet - Text Editor Shortcut Reference

Sublime's strength lies in two things rather than in feature count. The first is multi-cursor editing, which lets one edit happen in many places at once - renaming a variable or prefixing several lines is a few keystrokes here and often a plugin or manual repetition elsewhere. The second is search and snippets, where cross-file regex replacement and custom templates absorb a large amount of repetitive daily work. This sheet is organised into basic editing, multi-cursor editing, navigation and selection, search and replace, windows and panels, and snippets. Reach for it when handling large text files, when the same structural change must be applied in many places, or when you simply do not want to launch a full IDE to fix one file. The test for choosing it over a complete IDE is simple: if the task involves project-wide refactoring, debugging and dependency management, what Sublime lacks will not disappear with practice; but if the work is find, change, jump and bulk-replace, it is clearly the faster option.

Dev Tools·46 commands·Last updated 2026-07-21

Typical Use Case

For developers who want very fast text editing without booting a heavyweight IDE for a small job. Multi-cursor comes first: Cmd+D selects repeated words one by one, Cmd+K Cmd+D skips the current selection and keeps going, and typing plus Tab rewrites them all at once. Goto Anything (Cmd+P) handles files, file.js:42 for a line and file.js@symbol for a definition. Expand selection to tag or bracket contents before structural edits, and fall back to Cmd+Shift+P whenever a shortcut resists memory.

Basic Editing 10

Cmd + D
Select next matching word
Cmd + Shift + D
Duplicate current line below
Cmd + Shift + K
Delete whole line
Cmd + Shift + V
Paste and indent
Cmd + /
Toggle line comment
Cmd + Option + /
Toggle block comment
Cmd + ]
Increase indent
Cmd + [
Decrease indent
Cmd + Shift + [
Fold code block
Cmd + Shift + ]
Unfold code block

Multi-cursor Editing 8

Cmd + Click
Add multiple cursors
Cmd + Option + ↑
Add cursor above
Cmd + Option + ↓
Add cursor below
Cmd + Option + A
Select all matches
Cmd + L
Select whole line and add cursor at end
Cmd + Shift + L
Split multiple lines into multiple cursors
Cmd + D
Select next matching word
Cmd + K, Cmd + D
Skip current selection, select next

Windows & Panels 7

Cmd + Option + 2
Split left/right (2 columns)
Cmd + Option + 3
Split left/right (3 columns)
Cmd + Option + Shift + 2
Split top/bottom (2 rows)
Cmd + Ctrl + 2
Grid split (2x2)
Cmd + K, Cmd + B
Toggle sidebar
Cmd + Shift + P
Command Palette
Cmd + Option + T
Lift current file to a new window

Snippets 5

Tab
Expand snippet
Cmd + Option + Space
Trigger auto-completion
Cmd + Space
Trigger snippet
Cmd + Option + P
View current file syntax
Cmd + Shift + P
Command Palette (set syntax)

Parameter matrix

ParameterEffectExample
Cmd + DSelect the next occurrence of the same word and add a cursor to eachCmd + D
Cmd + K, Cmd + DSkip the current selection and continue selecting the next matchCmd + K, Cmd + D
Cmd + ClickAdd a cursor where you clickCmd + Click
Cmd + Option + ↑ / ↓Add a cursor above / belowCmd + Option + ↑
Cmd + Option + ASelect all matches in the current fileCmd + Option + A
Cmd + LSelect the whole line and add a cursor at its endCmd + L
Cmd + Shift + LSplit multiple lines into multiple selectionsCmd + Shift + L
Cmd + Shift + DDuplicate the current line belowCmd + Shift + D
Cmd + Shift + KDelete the whole lineCmd + Shift + K
Cmd + Shift + VPaste and indent according to contextCmd + Shift + V
Cmd + /Toggle line commentCmd + /
Cmd + Option + /Toggle block commentCmd + Option + /
Cmd + ] / Cmd + [Increase indent / decrease indentCmd + ]
Cmd + Shift + [ / ]Fold / unfold code blockCmd + Shift + [
Cmd + PGoto Anything, open quickly by file namefile.js:42
Cmd + RGo to symbol (function, class)Cmd + R
Cmd + GGo to a specific line numberCmd + G
Cmd + ;Go to the word under the cursorCmd + ;
Cmd + Option + → / ←Switch to the next / previous fileCmd + Option + →
Cmd + Shift + ASelect the content inside an HTML tagCmd + Shift + A
Cmd + Shift + SpaceSelect the content inside bracketsCmd + Shift + Space
Cmd + FFind within the current fileCmd + F
Cmd + Option + FReplace within the current fileCmd + Option + F
Cmd + Shift + FFind in multiple filesCmd + Shift + F
Cmd + Shift + HReplace in multiple filesCmd + Shift + H
Cmd + IIncremental find from the cursorCmd + I
Cmd + Shift + IIncremental reverse find from the cursorCmd + Shift + I
Cmd + Option + 2Split into 2 columns left and rightCmd + Option + 2
Cmd + Option + 3Split into 3 columns left and rightCmd + Option + 3
Cmd + Option + Shift + 2Split into 2 rows top and bottomCmd + Option + Shift + 2
Cmd + Ctrl + 2Grid split into 2×2Cmd + Ctrl + 2
Cmd + K, Cmd + BShow or hide the sidebarCmd + K, Cmd + B
Cmd + Shift + PCommand palette, runs almost any commandCmd + Shift + P
Cmd + Option + TMove the current file into a new windowCmd + Option + T
TabExpand a snippetTab
Cmd + Option + SpaceTrigger autocompleteCmd + Option + Space
Cmd + SpaceTrigger snippet completionCmd + Space
Cmd + Option + PView the current file's syntax modeCmd + Option + P

Common pitfalls

SymptomBatch renaming also changes places it should not.

CauseCmd + Option + A selects every match in the whole file at once, including the same-named content in comments and strings.

FixUse Cmd + D to pick the positions to change one by one, and Cmd + K, Cmd + D to skip unwanted matches.

SymptomPasted code has messy indentation and does not match the target file's style.

CausePlain paste was used; the pasted content keeps the source file's indentation.

FixUse Cmd + Shift + V so the editor re-indents according to the target context.

SymptomCmd+P opened the file but did not jump to the expected line.

CauseOnly the file name was typed; the :line syntax must be in the same input string with no space in between.

FixType file.js:42 directly in Cmd+P, and use file.js@function for symbol jumps.

SymptomAfter a project-wide replace the app would not run; some files were not actually matched.

CauseCmd+Shift+H replaces only within the search results by default, and a few files are excluded by syntax or filter conditions.

FixConfirm the matched file list in the replace panel, clear the filter conditions and rerun, then check the syntax of the changed files.

SymptomAfter folding a code block you forget where it is and the file looks like a big section is missing.

CauseCmd+Shift+[ folds the region, and the fold marker is not obvious in the gutter.

FixUse Cmd+Shift+] to unfold, or unfold all via the command palette; before editing, turn off the folded view to avoid misjudging the file content.

SymptomYou cannot find a command with Cmd+Shift+P and assume the plugin is not installed.

CauseThe command palette lists only commands available under the current file's syntax, so unrecognized file types filter out a batch.

FixFirst use Cmd+Option+P to confirm the current file's syntax mode, switch it correctly, then search the command in the palette.

SymptomThe comment shortcut does nothing and the code is output as-is.

CauseThe current file's syntax mode was not recognized correctly; it uses a language without block comments or plain-text mode.

FixUse Set Syntax in the command palette to specify the correct syntax, then run Cmd+Option+/ for block comments.

Troubleshooting

  1. 1Jump to a target file by a filename fragment

    Cmd + P

    Type a fragment to filter; append :line or @symbol to narrow down to a position.

  2. 2Batch-edit a repeatedly occurring identifier

    Cmd + D

    Press repeatedly to add matches one by one; when it hits an unwanted position use Cmd + K, Cmd + D to skip to the next.

  3. 3Add a uniform prefix to multiple lines or change their indentation

    Cmd + Shift + L

    Split multiple lines into multiple selections and type directly, then press Esc to end multi-cursor.

  4. 4Change only the content inside brackets without touching the outer structure

    Cmd + Shift + Space

    Select layer by layer in nested calls, more reliable than manually locating each bracket.

  5. 5Find references of a symbol across files

    Cmd + Shift + F

    After typing the keyword it lists the matching files and lines; jump to each to confirm before deciding whether to replace.

  6. 6The universal entry point when you do not remember shortcuts

    Cmd + Shift + P

    Type a fragment of the command name to match; syntax switching, splitting, folding and more can all be done here.

  7. 7View multiple files at once

    Cmd + Option + 2

    2-column split; for 3 columns use Cmd + Option + 3, and for a 2×2 grid use Cmd + Ctrl + 2.

Command Examples

Multi-cursor bulk rename or affix editing

// 1. Place the cursor on the target word // 2. Press Cmd + D repeatedly to select the next occurrence of the same word // 3. Type directly to replace all selections // 4. Press Esc to exit multi-cursor

Editing a name that appears thirty times by hand is slow and error-prone. Cmd + D accumulates selections so one keystroke rewrites all of them, while Cmd + K, Cmd + D skips the current hit — useful when you must exclude a spot.

Split lines into multiple cursors to edit them all at once

// Select several lines, then press Cmd + Shift + L // Each line becomes a cursor; type/delete line by line // Or press Cmd + L to select the whole line first, then Cmd + Shift + L

The fastest way to quote, comment or suffix a block of lines. Cmd + Shift + L splits by line, and Cmd + Option + ↑/↓ inserts cursors above or below without selecting anything first.

Watch four files at once in a 2x2 grid

// Cmd + Ctrl + 2 grid split (2×2) // Cmd + Option + 2 left-right split (2 columns) // Cmd + Option + Shift + 2 top-bottom split (2 rows) // Cmd + K, Cmd + B toggle the sidebar to free up space

When a change touches a component, its store and its test at once, a 2x2 grid beats tab-switching. Toggling the sidebar with Cmd + K, Cmd + B hands the width back to the editor.

Prefix-scoped search inside Goto Anything

// Cmd + P type: api matches file name apiController.ts // Cmd + R type: useCounter matches symbol (function/class) // Cmd + G type: 248 jump to line 248 // Cmd + ; type: handler jump to the word

The colon syntax inside Cmd + P is why it outpaces most editors: : for a line, @ for a symbol, # for a definition. Matching is subsequence-based, so partial names still land on the right file.

Output

apiController.ts
useCounter()

Change the syntax mode from the Command Palette

// When the file is not recognized by extension (such as .conf, .tpl) // Press Cmd + Shift + P, type: Set Syntax // Then search and select the target language // Or type Syntax: Open All with current extension as

A wrong syntax mode breaks indentation, bracket matching and snippets, which shows up as "Tab stopped working in this one file". Set Syntax fixes it, and the same palette can pin the choice for the extension.

Common Pitfalls

  • Paste and Indent re-flows multi-line content against the target indentation, so tables or tab-aligned text copied from a terminal lands misaligned. Use plain Cmd + V for terminal output.
  • Sublime is not version control: a crash loses unsaved buffers even with auto-save on. Keep Cmd + S habits or lean on external git commits as the safety net.
  • Untitled Cmd + N buffers are easy to clobber when moving between windows; save scratch files explicitly or the content vanishes on switch or quit.
  • Setting the wrong syntax mode disables Tab expansion and snippets, which reads as a broken plugin. Confirm the mode via the status bar before debugging anything else.
  • Cmd + D multi-selections do not survive closing the file; all cursor state is lost, so land long-range edits in a file first.
  • A misconfigured ignore or folder-colorize rule hides a directory from Goto Anything, so the file looks missing when it is merely excluded. Check the project ignore settings.

Tips

  • Cmd+P is Sublime's killer feature; type part of a filename to jump quickly.
  • Multi-cursor editing is Sublime's strength; Cmd+D batch-edits variable names.
  • The Command Palette (Cmd+Shift+P) runs almost any command without memorizing shortcuts.
  • Goto Anything (Cmd+P) supports :line and @symbol syntax, e.g. file.js:42 or file.js@function.
  • After installing Package Control you can extend features; press Cmd+Shift+P and type install.

FAQ

How does Cmd + D really work, and why do bulk renames miss occurrences?

Cmd + D selects the next occurrence of the same word: press once to select the word under the cursor, again to extend the selection to the next occurrence, keep pressing to ring a set of identical words — and then any typing or replacement applies to every selected span at once. Renames come out incomplete when you never finish expanding the selection, or when you accidentally press Cmd + k, Cmd + D, which skips the current selection and moves to the next (useful for deliberately leaving one occurrence alone). Cmd + Option + A selects all matches in one step. Strategy: use Cmd + Option + A by default, and fall back to stepwise Cmd + D when you need to skip an individual hit.

Besides a filename, what else can I type into Cmd + P?

Goto Anything understands three prefix forms. Plain text does a fuzzy filename match and opens the hit. A :42 style prefix jumps to line 42 of that file, and an @function prefix jumps to a symbol such as a function inside it. Dedicated companions exist too: Cmd + R for a symbol, Cmd + G for a line number and Cmd + ; for a word. They combine, so file.js:42 lands on both file and line. Once your project has too many files to navigate by memory, these prefixes beat clicking through directories. And if you would rather memorise nothing, Cmd + Shift + P runs almost any command; typing install there opens Package Control for extensions.

How do I create and grow multi-cursor selections, and which range shortcuts should I learn?

Creating cursors: Cmd + Click drops an extra cursor where you click, and Cmd + Option + ↑ / ↓ adds a cursor on the line above or below at the same column. Creating selections: Cmd + L selects the whole line and leaves a cursor at its end, and Cmd + Shift + L splits the current multi-line selection into one cursor per line — the best tool for appending something to every line. Growing range: Cmd + Shift + A selects inside an HTML tag and Cmd + Shift + Space selects inside brackets. The mnemonic: Cmd handles "select", Cmd + Option handles "many", Option with ↑/↓ adds vertical cursors, and Shift + L / A / Space adds context range.

Please do not mix up find, find-in-files and replace — which key does which?

Cmd + F searches within the current file; Cmd + I is the incremental version of the same thing that jumps as you type, and Cmd + Shift + I searches incrementally backwards. Go cross-file with Cmd + Shift + F. Replacement comes in two levels: Cmd + Option + F replaces in the current file, and Cmd + Shift + H replaces across the project. The incremental variants suit following your eyes through a large file, since the current hit updates as you type; plain Cmd + F gives a tidier complete result. Always run a Cmd + Shift + F first to see the hit count before a project-wide replace.

Memorise shortcuts or use the command palette — and how should I lay out splits?

If you cannot remember, use the palette: Cmd + Shift + P runs essentially any command by name, and re-setting the current file's syntax lives there too, so it is the universal fallback. Only Cmd + P is truly worth memorising. For layout, Cmd + Option + 2 gives two columns, Cmd + Option + 3 three columns, Cmd + Option + Shift + 2 two stacked rows, and Cmd + Ctrl + 2 a 2×2 grid. Cmd + k, Cmd + B toggles the sidebar, and Cmd + Option + T promotes the current file into its own window. Cmd + Option + P shows the syntax of the active file.

Official References

Each command links to its official documentation below, so you can verify the latest usage and read deeper.

Maintained by LaoHand

Publicly updated on Jul 21, 2026, continuously proofread against official docs.

Contact Us

Wrong command or description? Send us corrections, business inquiries or product feedback by email.

Contact Us