visual-studio-codemarkdownfile-link

VS Code Markdown - is there a clever way to make links intellisense?


I've started using VisualStudio Code and Markdown as a note-taking tool - something akin to Zettelkasten. As part of this note-taking system, notes should always be linking to other notes/files.

As recovering developer I start to write: [Decision Making Techniques](.\ ) - when I type .\ and then ctrl+space I expect a list of filenames. Instead, I get a list of words.

Is there a simple? (gasp elegant way?) to have IntelliSense recognize filenames as distinct kind of thing in Markdown mode?


Solution

  • And speaking of clever ways to make markdown links, vscode 1.76 is adding the ability to easily make a link to any header in the same file or another markdown file. See markdown header links: v1.76 Release Notes:

    Need to link to a header in another Markdown document but don't remember or want to type out the full file path? Try using workspace header completions! To start, just type ## in a Markdown link to see a list of all Markdown headers from the current workspace

    (my demo):

    markdown header links suggestions

    You can configure if/when workspace header completions show with the markdown.suggest.paths.includeWorkspaceHeaderCompletions setting. Valid setting values are:

    • onDoubleHash (the default) — Show workspace header completions only after you type ##.
    • onSingleOrDoubleHash — Show workspace header completions after you type # or ##.
    • never — Never show workspace header completions.

    Keep in mind that finding all headers in the current workspace can be expensive, so there may be a slight delay the first time they are requested, especially for workspaces with lots of Markdown files.


    In the Insiders Build v1.64 there is now path intellisense for markdown links.

    Enable this setting: markdown.suggest.paths.enabled default is true

    See Commit: Add basic markdown link completions

    Only normal links for now. Will add reference links later. Should support the forms:

    • [](dir/file.md)
    • [](./dir/file.md)
    • [](/root-dir/file.md)
    • [](#header)
    • [](./dir/file.md#header)

    See also https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_64.md#markdown-path-intellisense