Skip to content

Neovim for Markdown

After some time in picking up Vim/Neovim, I've now replaced Typora/VS Code with Neovim to write most of the Markdown files. So here is a run down of my configurations regarding Markdown setup in Neovim.

Here is the demo

bullets.vim

conform.nvim

Embedded Language Formatting

This one is a little tricky because the configuration is connected by seemingly stretched trails, from a distance afar.

Neovim >> conform.nvim (formatting.lua) >> Prettier >> prettierrc.json

First available in v2.1.0

Control whether Prettier formats quoted code embedded in the file.

When Prettier identifies cases where it looks like you've placed some code it knows how to format within a string in another file, like in a tagged template in JavaScript with a tag named html or in code blocks in Markdown, it will by default try to format that code.

Sometimes this behavior is undesirable, particularly in cases where you might not have intended the string to be interpreted as code. This option allows you to switch between the default behavior (auto) and disabling this feature entirely (off).

json
{
  "embeddedLanguageFormatting": "off"
}

With this setting added to your prettierrc.json file under the project folder, Prettier will no longer format the code blocks in your Markdown files.

todo-comments.nvim

Todo matches on any text that starts with one of your defined keywords (or alt) followed by a colon:

  • TODO: do something
  • FIX: this should be fixed
  • HACK: weird code warning

Todos are highlighted in all regular files.

  • :todoQuickFix
  • :TodoLocList
  • :Trouble todo
  • :TodoTelescope, <leader>ft

quick insert comments in md files

toggle between todo and completed

render-markdown.nvim