Visual Studio Code (VS Code) is the most popular code editor in the world today. Lightweight, free, and backed by a very rich extension ecosystem, VS Code is the primary choice of millions of developers across various fields. But many people only use it as an ordinary text editor, when in fact there's a wealth of features and shortcuts that can multiply your productivity if used correctly.
Installation and Initial Configuration
Download VS Code from https://code.visualstudio.com. After installing, enable some basic settings that will improve your work comfort. Open the Command Palette with Ctrl+Shift+P (or Cmd+Shift+P on Mac), type Open Settings JSON, and add the following configuration:
{
"editor.fontSize": 14,
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.wordWrap": "on",
"editor.minimap.enabled": false,
"files.autoSave": "onFocusChange"
}
Keyboard Shortcuts You Must Master
Shortcuts are the fastest way to increase your working speed in VS Code:
Ctrl+P— Open a file quickly (Quick Open).Ctrl+Shift+P— Open the Command Palette.Ctrl+`— Open the integrated terminal.Alt+Up/Down— Move a line up or down.Ctrl+D— Select the next matching word (multi-cursor editing).Ctrl+Shift+K— Delete an entire line.Ctrl+/— Toggle a comment on the selected line.F12— Go to Definition (jump to a function or variable definition).Ctrl+B— Toggle the sidebar.Ctrl+Shift+F— Search across the whole project.
Extensions You Should Install
Extensions significantly expand VS Code's capabilities. Here are the recommended extensions:
- Prettier — Automatic code formatting so it's neat and consistent.
- ESLint — Detect errors and JavaScript style issues.
- GitLens — Show Git information directly inside the editor.
- Live Server — A local server with auto-reload for web development.
- PHP Intelephense — Autocomplete and error checking for PHP.
- Auto Rename Tag — Change the opening and closing HTML tags at the same time.
- Path Intellisense — Autocomplete for file paths.
- Material Icon Theme — More informative folder and file icons.
Using the Integrated Terminal
VS Code has a built-in terminal that is very useful. Open it with Ctrl+` and you can run Git, npm, or composer commands without leaving the editor:
git status
npm install
php artisan serve
You can also open several terminals at once by clicking the + icon in the terminal panel.
The Multi-Cursor Editing Feature
One of the most productive features in VS Code is the multi-cursor. You can edit many places at once:
Alt+Click— Add a cursor at any position.Ctrl+D— Select the next occurrence of the selected word.Ctrl+Shift+L— Select all occurrences of the same word at once.
Project-Based Workspace and Settings
VS Code lets you save project-specific settings. Create a .vscode folder in the project root and add a settings.json file:
{
"editor.tabSize": 4,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[php]": {
"editor.tabSize": 4
}
}
These settings apply only to that project and can be committed to Git so the whole team uses the same settings.
Using Custom Snippets
Create your own code snippets for templates you use often. Open File > Preferences > Configure User Snippets, choose a language, then add:
"PHP Class": {
"prefix": "phpclass",
"body": [
"class ${1:ClassName} {",
" public function __construct() {",
" $2",
" }",
"}"
],
"description": "PHP Class template"
}
Type phpclass then press Tab to use it.
Conclusion
VS Code isn't just an ordinary text editor — it's a complete development environment if you know how to take advantage of it. Start by mastering the basic shortcuts, install extensions relevant to the technology you use, and take advantage of the integrated terminal to save time. The more you explore its features, the faster and more comfortable your coding process becomes every day.