Vscode Tricks
Vscode Tricks
workflow:
- **Shortcut**:
- Windows/Linux: `Ctrl + Alt + Down` (or `Up`) to add cursors below/above.
- macOS: `Cmd + Option + Down` (or `Up`).
- **Another way**: Hold `Ctrl` (Windows) or `Cmd` (macOS) and click anywhere in the
editor to add multiple cursors.
---
- **Shortcut**:
- Windows/Linux: `Ctrl + P`
- macOS: `Cmd + P`
- Start typing the file name and hit `Enter` to open it directly.
---
- **Shortcut**:
- Windows/Linux: `Alt + F12`
- macOS: `Option + F12`
- This is great for inspecting code without losing your place.
---
- **Shortcut**:
- Windows/Linux: `Ctrl + ~`
- macOS: `Cmd + ~`
- You can also open a new terminal by clicking **Terminal** → **New Terminal** from
the top menu.
---
- **Shortcut**:
- Windows/Linux: `Ctrl + \`
- macOS: `Cmd + \`
- You can then move files between these panes by dragging them.
---
### 6. **Emmet Abbreviations**
Use Emmet to write HTML/CSS more quickly. For example, typing
`div.container>ul>li*5` will expand to a `<div>` with a container class and an
unordered list with 5 list items.
- **Example**: Type `ul>li*5` and press `Tab` to generate a list with 5 items.
---
- **Shortcut**:
- Windows/Linux: `F2`
- macOS: `F2`
- After selecting a variable or function, press `F2` to rename it, and VSCode will
update all instances.
---
---
- To install: Go to the Extensions panel (`Ctrl + Shift + X`), search for **Live
Server**, and install it.
- After installation, right-click on your `index.html` file and select **Open with
Live Server**.
---
---
By mastering these VSCode tricks, you'll be able to develop more efficiently and
reduce the time spent on repetitive tasks. These tricks help improve navigation,
editing, and overall productivity.