Issue #39 (Basic Markdown Features)01/18/23
|
Get a weekly dose of tools, articles, and other resources covering remote work, productivity, career well-being, and lots more.
|
|
|
Most developers have to write Markdown at some point, either for a README file or possibly some piece of content for a blog or documentation. Whatever the case,
VS Code has a number of useful Markdown-related features that you can take advantage of.
First of all, any Markdown file you're currently editing will display a
document outline in VS Code's Explorer sidebar panel. You can see the outline by opening the Explorer (CTRL/CMD-SHIFT-E).
You can also jump to any heading in a Markdown file by double-clicking the outline headings or by hitting CTRL/CMD-SHIFT-O, which brings up a symbol search that shows all the headings in the document. CTRL/CMD-T does the same kind of search across multiple files in the current workspace.
To help with Markdown syntax, press CTRL/CMD-SPACE (the common way in VS code to trigger auto-suggest) anywhere in a Markdown file to
view a list of autocompletions. This comes in handy mostly for those new to Markdown. And for more experienced Markdown users, you can create your own snippets that can be accessed in the same way.
You can instantly insert the
syntax to embed an image or link to a file in any Markdown document by dragging the file into the editor window, then hitting SHIFT before dropping it. Dropped images will add a Markdown image using the format !
[](path/image.png) and other dropped files will add a Markdown link in the format
[](path/file.md).
Similar to HTML, Markdown doesn't honor extra whitespace unless it's related to the Markdown syntax (for example, when using two spaces at the end of lines to indicate a line break). You can change this behaviour and allow VS Code to recognize real line breaks inside paragraphs by changing "Markdown > Preview: Breaks" to "true" in your settings:
And lastly, if you're writing Markdown, it's always nice to see how your file will render. You can
open VS Code's preview window by clicking the little "Open Preview..." button, that looks like a little book icon, in the top-right area of your editor (not the "split editor" button, which looks similar). This shows a live preview of your Markdown document. You can preview either side-by-side or in a new file (ALT/OPT-click the preview button).
There are other advanced features you can use and customize when writing Markdown in VS Code, but I'll discuss those in a future issue.