HIST289

Working with XML in VS Code

These instructions assume you’ve already installed the following extensions:

Together, these extensions provide syntax highlighting, validation, formatting, autocompletion, and tag helpers for working with XML.


1. Core Features of the Extensions


2. Useful Shortcuts

Wrap text with a tag

  1. Highlight the text you want to wrap.
  2. Press the shortcut:
    • Windows/Linux: Alt + W
    • Mac: Option + W
  3. Type the element name (e.g., p, item, div) and press Enter.
  4. The extension will automatically add <tag> ... </tag> around the selection.

3. Turning Off Code Suggestions

By default, VS Code may suggest completions that feel overwhelming to new users. To reduce this:

  1. Open Settings (Ctrl + , or Cmd + , on Mac).
  2. Search for “suggestions”.
  3. Toggle off:
    • Editor › Quick Suggestions (set to false)
    • Or limit them by language: add to settings.json:

    ```json “[xml]”: { “editor.quickSuggestions”: false }

4. Soft Wrapping (No Horizontal Scrolling)

To make long XML lines wrap at the edge now of the editor window:

  1. Open Settings (Ctrl + , on Windows/Linux, Cmd + , on Mac).
  2. Search for “word wrap.”
  3. Set Editor: Word Wrap to on.
    Optional: Set Editor: Word Wrap Column (e.g., 100–120) if you want a fixed wrap width.

5. General Ease-of-Use Tips