
VS Code Shortcuts and Features Every Developer Should Know
Most developers spend hours in VS Code but rarely move beyond opening files, editing code, and running commands. A few familiar shortcuts can make those everyday tasks easier, starting with the Command Palette. Press Ctrl+Shift+P on Windows and Linux, or Cmd+Shift+P on macOS, and type the action you want to perform. You can select a formatter, change the current file’s language mode, or run a task without searching through menus. For opening files, use Ctrl+P, or Cmd+P on macOS, to launch Quick Open. Enter part of a filename and select the result. Including part of the directory path helps when a repository contains several files named index.ts or config.json. Once inside a file, Ctrl+Shift+O, or Cmd+Shift+O on macOS, displays its symbols, including functions, methods, and classes where supported. This is much easier than scrolling through a long file to find one method. When you need to understand a function call, F12 opens its definition if the language support can resolve it. Peek Definition provides another option: inspect the implementation without leaving your current position. These features are particularly useful when joining an unfamiliar project, tracing a request through several services, or checking how a shared utility works. You do not need to memorize every navigation command immediately. Start with Quick Open and the Command Palette, then add symbol navigation when scrolling and searching begin to interrupt your work. code.visualstudio.com
Multi-cursor editing is useful when several pieces of text need the same change. Select a word and press Ctrl+D on Windows and Linux, or Cmd+D on macOS, to select its next occurrence. Repeat until you have the matches you want, then type once to update them together. This works well for repeated configuration values, similar test descriptions, or small adjustments across related lines. You can also place cursors manually with Alt+Click on Windows and Linux, or Option+Click on macOS. Check the selections before typing, because identical text can appear in places with different meanings. For renaming a variable or function, use F2 to invoke Rename Symbol instead. With suitable language support, VS Code identifies references to the symbol and updates them, potentially across multiple files. Preview the changes when available, particularly for widely used functions or exported names. Moving code is another task that becomes easier with a shortcut. Alt+Up and Alt+Down move the current line or selected block on Windows and Linux; on macOS, use Option+Up and Option+Down. This avoids the extra steps involved in cutting, repositioning the cursor, and pasting. To comment or uncomment a line, use Ctrl+/ on Windows and Linux, or Cmd+/ on macOS. Select several lines first to apply the command to a larger section. These shortcuts are easy to learn through ordinary work because each replaces an action you probably repeat several times a day. code.visualstudio.com
Project search becomes more effective when you narrow its scope before reviewing the results. Open workspace search with Ctrl+Shift+F on Windows and Linux, or Cmd+Shift+F on macOS. Use the inclusion and exclusion fields to focus on relevant directories or file types. When investigating backend behavior, excluding unrelated frontend files and generated output can make the implementation easier to locate. Whole-word matching and case sensitivity help when common names produce too many results. Before replacing text across a repository, inspect the matches rather than assuming every occurrence needs changing. Formatting also benefits from a deliberate setup. Choose the appropriate default formatter and enable Format on Save if it fits the project’s conventions. Keeping shared formatting configuration in the repository helps prevent personal editor settings from producing unnecessary changes. A reviewer should be able to identify the actual fix without sorting through unrelated spacing adjustments. Snippets address another recurring task: writing the same small code structure repeatedly. A custom snippet can insert a test case, logging statement, or error-handling block with placeholders for the details that change. Tab stops let you move through those placeholders in order. Keep snippets small enough to inspect and update them when project conventions change. Large templates can carry outdated assumptions into new code, especially when copied between services with different requirements. The useful part is avoiding repetitive typing while still checking whether the resulting code makes sense in its current location. code.visualstudio.com
The integrated debugger deserves attention when print statements leave you uncertain about what happens between two points in a program. Set a breakpoint beside a line, start a debugging session, and inspect the application when execution pauses. You can examine variables, inspect the call stack, and step through statements to follow the execution path. Conditional breakpoints help when a failure occurs only for a particular request, value, or loop iteration. Depending on the language, you may need an extension or launch configuration before starting. Once configured, debugging can reduce repeated rounds of adding logs and rerunning the application. Before committing your changes, open the Source Control view and review each file’s diff. This often reveals leftover debugging statements, accidental edits, or formatting changes unrelated to the task. Stage selected changes where appropriate, especially when a completed fix shares a file with an unfinished experiment. Focused commits are easier to review and understand later. Finally, customize shortcuts that feel awkward or conflict with your keyboard layout, operating system, or extensions. Open Keyboard Shortcuts with Ctrl+K followed by Ctrl+S on Windows and Linux, or Cmd+K followed by Cmd+S on macOS. Search for a command, assign a comfortable combination, and check for existing conflicts. Choose a few actions you repeat regularly and practice those first. A useful editor setup develops through actual work, with each adjustment removing a specific frustration you encounter often.