Live preview
The render-markdown.nvim plugin renders Markdown in the buffer:Features
Headings
Different styles and icons for each heading level
Code blocks
Syntax highlighting within fenced code blocks
Lists
Rendered bullet points and checkboxes
Tables
Properly aligned table rendering
Links
Concealed URLs with descriptive text
Emphasis
Bold, italic, and strikethrough rendering
Treesitter integration
MDX support
MDX (Markdown + JSX) is fully supported:The mdx.nvim plugin must be loaded early (not lazy) so
.mdx files are detected correctly.What is MDX?
MDX allows you to use JSX components in Markdown:- Documentation sites (Docusaurus, Nextra)
- Blogs with interactive elements
- Component documentation
Language server
Markdown Oxide LSP is available but currently disabled:after/lsp/markdown_oxide.lua for future use.
markdown_oxide features
When enabled, it provides:- Daily note navigation
- Wiki-style linking
- Code lens for references
- Vault-wide search
Grammar and spell checking
The harper_ls language server provides grammar checking:What harper_ls checks
- Grammar errors
- Spelling mistakes
- Style suggestions
- Common writing issues
Supported filetypes
markdownmdxgitcommit- Plain text files
Formatting
Markdown files are formatted with markdownlint-cli2:markdownlint configuration
Create a.markdownlint.jsonc file in your project root:
Linting
Markdown linting also uses markdownlint-cli2:<leader>ll.
The same tool is used for both formatting and linting. Formatting fixes issues automatically, while linting reports them.
Common workflows
Live preview
- Open a Markdown file
- Preview renders automatically
- Edit and see changes in real-time
Working with headings
Headings render with different styles:#renders largest##slightly smaller- Continue through
######
Code blocks
- lua, python, javascript, typescript
- go, rust, c, cpp
- bash, sh, zsh
- json, yaml, toml
- And many more via Treesitter
Tables
Lists and checkboxes
Links
MDX-specific features
Component imports
Props and attributes
Mixing markdown and JSX
Keymaps
Standard LSP keymaps (when harper_ls or markdown_oxide is active):| Keymap | Action |
|---|---|
K | Hover documentation |
ga | Code action (fix grammar/spelling) |
<leader>fb | Format with markdownlint |
<leader>ll | Lint file |
]d / [d | Next/prev diagnostic |
Installation summary
Troubleshooting
Preview not rendering
- Check Treesitter is installed:
:TSInstall markdown - Verify render-markdown is loaded:
:Lazy - Try toggling render:
:RenderMarkdown toggle
MDX not recognized
- Verify mdx.nvim is loaded:
:Lazy - Check filetype:
:set filetype?(should bemdx) - Restart Neovim
Grammar checking not working
- Check harper_ls is installed:
harper-ls --version - Run
:LspInfoCustomto see if it’s attached - Verify filetype is supported
- Check logs:
:LspLog
Formatting not working
- Check markdownlint is installed:
markdownlint-cli2 --version - Run
:ConformInfo - Manually format:
<leader>fb - Check for
.markdownlint.jsoncconflicts
Advanced configuration
Custom render-markdown settings
Editlua/plugins/languages/markdown.lua:6 to customize rendering:
Enable markdown_oxide
-
Uncomment in
lua/plugins/lsp/init.lua:53: -
Uncomment config in
after/lsp/markdown_oxide.lua - Restart Neovim
Custom markdownlint rules
Create.markdownlint.jsonc:
Next steps
TypeScript
For MDX with TypeScript components
Formatting
Learn more about formatters
Linting
Learn more about linters
LSP setup
Configure language servers