# Microsoft Visual Studio Code

# Diff opened tabs

Here are the quickest ways to diff two open tabs in VS Code:

**1. Command Palette (fastest)**

1. Focus the first tab.
2. Press `Cmd+Shift+P` and run **File: Compare Active File With...**
3. Pick the second file from the list; open editors appear at the top.

**2. Open Editors panel (works for unsaved/untitled tabs too)**

1. In the Explorer sidebar, expand **Open Editors**. If it's hidden, enable it from the `...` menu at the top of Explorer.
2. Right-click the first tab and choose **Select for Compare**.
3. Right-click the second tab and choose **Compare with Selected**.

**3. Explorer multi-select (for saved files)**  
`Cmd+click` both files in the file tree, then right-click and choose **Compare Selected**.

# Show markdown preview

VS Code has a built-in Markdown preview, so no extension is needed:

- **Preview beside the editor (live, side by side):** `Cmd+K`, then `V` on Mac, or `Ctrl+K`, then `V` on Windows/Linux.
- **Preview in its own tab:** `Cmd+Shift+V` on Mac, or `Ctrl+Shift+V` on Windows/Linux.
- **With the mouse:** click the preview icon (a split pane with a magnifying glass) at the top-right of the editor tab.
- **From the Command Palette:** press `Cmd+Shift+P` and run **Markdown: Open Preview to the Side**.

A few useful extras:

- The side-by-side preview scrolls along with the editor. You can turn this on or off with the setting `markdown.preview.scrollPreviewWithEditor`.
- Double-clicking in the preview jumps to that line in the source.
- For Mermaid diagrams, GitHub-style alerts, or other extended syntax, install **Markdown Preview Enhanced** or **Markdown Preview Mermaid Support**.