DEV Community

Cover image for TIL: Visual Studio Code does markdown autocompletion for in-page links
Christian Heilmann
Christian Heilmann

Posted on • Originally published at christianheilmann.com

7 4

TIL: Visual Studio Code does markdown autocompletion for in-page links

When you write markdown files, headings automatically also get an ID generated so they become in-page targets to link to. This is also used to create a table of contents in various publishing systems.

This means

## Side effects of 24 hour compound V
Enter fullscreen mode Exit fullscreen mode

becomes

<h2 id="side-effects-of-24-hour-compound-V">
  Side effects of 24 hour compound V
</h2>
Enter fullscreen mode Exit fullscreen mode

Today I learned that VS Code also offers these generated IDs as an autocomplete when you type links. If you wrap the word you want to link in square brackets and you add the parenthesis to type the target the link should point to starting this one with a # will offer all the possible target IDs in the current document.

Visual Studio Code offering a list of all the generated IDs of headings for in-page links

Neat!

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay