Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/0x00-ketsu/markdown-preview.nvim
A Neovim plugin renders markdown file in terminal buffer.
https://github.com/0x00-ketsu/markdown-preview.nvim
lua markdown markdown-preview neovim neovim-plugin plugin preivew
Last synced: 3 months ago
JSON representation
A Neovim plugin renders markdown file in terminal buffer.
- Host: GitHub
- URL: https://github.com/0x00-ketsu/markdown-preview.nvim
- Owner: 0x00-ketsu
- License: mit
- Created: 2023-02-02T03:41:14.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-24T10:20:35.000Z (9 months ago)
- Last Synced: 2024-06-17T19:02:32.290Z (5 months ago)
- Topics: lua, markdown, markdown-preview, neovim, neovim-plugin, plugin, preivew
- Language: Lua
- Homepage:
- Size: 25.4 KB
- Stars: 17
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# markdown-preview
A Neovim plugin renders markdown file in terminal buffer.
>
> This plugin relies on [Glow](https://github.com/charmbracelet/glow), only work under Linux or Mac.[video](https://user-images.githubusercontent.com/16932133/216219726-f79645fb-555a-4684-8962-c69e87a7d605.mp4)
## Features
- Open terminal buffer in different direction: `vertical`, `horizontal`.
- Support auto refresh when file content changed.## Requirements
- Install [Glow](https://github.com/charmbracelet/glow#installation)
## Installation
[Packer](https://github.com/wbthomason/packer.nvim)
```lua
-- Lua
use {
'0x00-ketsu/markdown-preview.nvim',
ft = {'md', 'markdown', 'mkd', 'mkdn', 'mdwn', 'mdown', 'mdtxt', 'mdtext', 'rmd', 'wiki'},
config = function()
require('markdown-preview').setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the setup section below
},
end
}
```[Lazy](https://github.com/folke/lazy.nvim)
```lua
-- Lua
require('lazy').setup({
'0x00-ketsu/markdown-preview.nvim',
ft = {'md', 'markdown', 'mkd', 'mkdn', 'mdwn', 'mdown', 'mdtxt', 'mdtext', 'rmd', 'wiki'},
config = function()
require('markdown-preview').setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the setup section below
},
end
})
```## Setup
Following defaults:
```lua
local mp = require('markdown-preview')
mp.setup(
{
glow = {
-- When find executable path of `glow` failed (from PATH), use this value instead
exec_path = '',
style = '', -- Path to glamour JSON style file
},
-- Markdown preview term
term = {
-- reload term when rendered markdown file changed
reload = {
enable = true,
events = {'InsertLeave', 'TextChanged'},
},
direction = 'vertical', -- choices: vertical / horizontal
keys = {
close = {'q', ''},
refresh = 'r',
}
}
}
)
```## Commands
- `:MPToggle`: toggle markdown preview open or close.
- `:MPOpen`: open markdown preview window.
- `:MPClose`: close markdown preview window.
- `:MPRefresh`: refresh markdown preview window.## Thanks
[glow.nvim](https://github.com/ellisonleao/glow.nvim)
## License
MIT