A Neovim plugin for rendering markdown files in terminal
- 💡 Any element (treesitter, regex_group) can be replaced with icons
- 💪 Built-in
markdown elements
config,markdown
files work out of the box - 💞 Built-in commands
MarkliveEnable
,MarkliveDisable
,MarkliveToggle
to enable/disable/toggle themarklive
feature - ✅ Built-in command
MarkliveTaskToggle
to toggle markdown task state (supports cascading according toaction.task.hierarchy
config) - 🛴 Supports automatically disabling the
marklive
feature on the current line for easy editing - 🔎 Highly configurable, allowing custom icons for each markdown element, and even custom displays for
html
files
- Neovim >= 0.5.0
- nvim-treesitter: Used for parsing files
- Nerd Fonts: (optional) Used for displaying icons
Using lazy.nvim
{
"yelog/marklive.nvim",
dependencies = { 'nvim-treesitter/nvim-treesitter' },
lazy = true,
ft = "markdown",
opts = {}
}
Using packer.nvim
use {
'yelog/marklive.nvim',
requires = { 'nvim-treesitter/nvim-treesitter' },
}
Using dein
call dein#add('nvim-treesitter/nvim-treesitter')
call dein#add('yelog/marklive.nvim')
Usingn vim-plug
Plug 'nvim-treesitter/nvim-treesitter'
Plug 'yelog/marklive.nvim'
The default configuration for marklive.nvim is shown in the link config.lua
You can use the command :MarkliveTaskToggle
to toggle the state of markdown tasks (checkboxes) under the cursor.
- Cascading (hierarchy) is enabled by default: toggling a parent task will also cascade the change to all its subtasks, and parent tasks will update their state based on their children.
- If you want to disable cascading, set
action.task.hierarchy = false
in your config. When disabled, only the current line's task state will be toggled.
Example config to disable cascading:
require('marklive').setup({
action = {
task = {
hierarchy = false
}
}
})
You can bind a shortcut to toggle the task state, for example, using <CR>
(Enter) in normal mode:
vim.keymap.set("n", "<CR>", "<cmd>MarkliveTaskToggle<cr>", { desc = "Toggle markdown task" })
If you don't want to use a Nerd Font, you can replace the icons with Unicode symbols.
- Implement background style rendering for Markdown’s
Block Quote
- Implement style rendering for Markdown’s
Code Block
marklive.nvim is licensed under the Apache 2.0 license