Skip to main content

25 VS Code Tips and Tricks

· 3 min read

  1. Multiple Cursors - To create multiple cursors in VS Code, hold down the Alt key and click in multiple places. This allows you to edit multiple lines at the same time.
  2. Zen Mode - To enter Zen mode, press Ctrl + K, Z. This maximizes the editor window and hides all the UI elements except for the text editor.
  3. Bracket Matching - Place the cursor on an opening or closing bracket and VS Code highlights the matching one.
  4. Command Palette - Press Ctrl + Shift + P to open the Command Palette, which lists all the available commands in VS Code.
  5. Integrated Terminal - Open the integrated terminal by pressing Ctrl + Shift + ~. This allows you to run commands without leaving VS Code.
  6. Split Editor - To split the editor window vertically or horizontally, press Ctrl + \\.
  7. Emmet Abbreviations - Emmet is a powerful tool to write HTML and CSS code quickly. To use Emmet abbreviations, type the abbreviation and press Tab.
  8. Quick Open - Press Ctrl + P to open the Quick Open panel, which allows you to quickly search for files in your project.
  9. Code Folding - Use Ctrl + Shift + [ to fold code blocks and Ctrl + Shift + ] to unfold them.
  10. IntelliSense - VS Code's IntelliSense feature provides autocomplete suggestions, parameter hints, and other useful information while you are typing.
  11. Peek Definition - To see the definition of a symbol without leaving your current file, right-click on the symbol and select Peek Definition.
  12. Go to Definition - To go to the definition of a symbol, press F12.
  13. Code Snippets - VS Code comes with a set of built-in code snippets, which you can trigger by typing a shortcut and pressing Tab.
  14. Code Formatting - To format your code, press Shift + Alt + F.
  15. Extension Marketplace - The Extension Marketplace is where you can find and install extensions for VS Code. You can access it by clicking on the Extensions icon in the Activity Bar.
  16. Integrated Git - VS Code has built-in Git support, which allows you to manage your Git repositories without leaving the editor.
  17. Debugging - VS Code has a powerful debugging feature that allows you to debug your code right from the editor.
  18. Workspace Settings - You can configure VS Code settings on a per-workspace basis by creating a .vscode/settings.json file in your project folder.
  19. Command Line Interface - You can open files and folders in VS Code from the command line by typing code . in the terminal.
  20. Themes - VS Code comes with a set of built-in themes, and you can also install custom themes from the Extension Marketplace.
  21. Keybindings - You can customize VS Code keybindings by opening the Keyboard Shortcuts editor (Ctrl + K, Ctrl + S).
  22. File Explorer - The File Explorer panel allows you to browse and manage your project files. You can open it by clicking on the Explorer icon in the Activity Bar.
  23. Search - To search for a string in your project, press Ctrl + Shift + F.
  24. Live Share - VS Code's Live Share feature allows you to collaborate with other developers in real-time.
  25. Custom Snippets - You can create your own custom code snippets by opening the User Snippets editor (Ctrl + Shift + P and then typing Preferences: Configure User Snippets).