markdown.md

 1# Markdown
 2
 3Markdown support is available natively in Zed.
 4
 5- Tree-sitter: [tree-sitter-markdown](https://github.com/tree-sitter-grammars/tree-sitter-markdown)
 6- Language Server: N/A
 7
 8## Syntax Highlighting Code Blocks
 9
10Zed supports language-specific syntax highlighting of markdown code blocks by leveraging [tree-sitter language grammars](../extensions/languages.md#grammar). All [Zed supported languages](../languages.md), including those provided by official or community extensions, are available for use in markdown code blocks. All you need to do is provide a language name after the opening <kbd>```</kbd> code fence like so:
11
12````python
13```python
14import functools as ft
15
16@ft.lru_cache(maxsize=500)
17def fib(n):
18    return n if n < 2 else fib(n - 1) + fib(n - 2)
19```
20````
21
22## Configuration
23
24### Format
25
26Zed supports using Prettier to automatically re-format Markdown documents. You can trigger this manually via the {#action editor::Format} action or via the {#kb editor::Format} keyboard shortcut. Alternately, you can automatically format by enabling [`format_on_save`](../reference/all-settings.md#format-on-save) in your settings.json:
27
28```json [settings]
29  "languages": {
30    "Markdown": {
31      "format_on_save": "on"
32    }
33  },
34```
35
36### List Continuation
37
38Zed automatically continues lists when you press Enter at the end of a list item. Supported list types:
39
40- Unordered lists (`-`, `*`, or `+` markers)
41- Ordered lists (numbers are auto-incremented)
42- Task lists (`- [ ]` and `- [x]`)
43
44Pressing Enter on an empty list item removes the marker and exits the list.
45
46To disable this behavior:
47
48```json [settings]
49  "languages": {
50    "Markdown": {
51      "extend_list_on_newline": false
52    }
53  },
54```
55
56### List Indentation
57
58Zed indents list items when you press Tab while the cursor is on a line containing only a list marker. This allows you to quickly create nested lists.
59
60To disable this behavior:
61
62```json [settings]
63  "languages": {
64    "Markdown": {
65      "indent_list_on_tab": false
66    }
67  },
68```
69
70### Trailing Whitespace
71
72By default Zed will remove trailing whitespace on save. If you rely on invisible trailing whitespace being converted to `<br />` in Markdown files you can disable this behavior with:
73
74```json [settings]
75  "languages": {
76    "Markdown": {
77      "remove_trailing_whitespace_on_save": false
78    }
79  },
80```