skip to Main Content

It is hard to read a markdown document in Visual Code if it contains links with long URLs. Is there a way to collapse/fold link addresses?

2

Answers


  1. As far as I can tell from looking through the markdown settings (you can try it yourself by triggering autocomplete/suggestions after typing markdownlink in a settings.json file), there is no setting that enables the behaviour you are looking for.

    One possible workaround would be to just read the markdown preview (instead of the source markup). You can do this with the buttons at the top right, or with these commands and keyboard shortcuts:

    • Markdown: Open Preview (ctrl+shift+v)
    • Markdown: Open Preview to the Side (ctrl+k,v)
    • Markdown: Open Locked Preview to the Side

    If you want the feature you are asking for, you can create a feature request on their GitHub issue tracker. If you do so, add a link here to the issue you create for posterity.

    Login or Signup to reply.
  2. There are two other options that make the long URL situation a bit more bearable:

    1. Disable word wrap (View menu or press ALT-Z).
    2. Use Reference Links

    Example:

        This is a [reference link][myexample]
    
        [myexample]: https://the-url
    

    See also How can I switch word wrap on and off in Visual Studio Code?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search