Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yaocccc/nvim-hl-mdcodeblock.lua
a nvim plugin for hignlight markdown codeblock.
https://github.com/yaocccc/nvim-hl-mdcodeblock.lua
Last synced: 14 days ago
JSON representation
a nvim plugin for hignlight markdown codeblock.
- Host: GitHub
- URL: https://github.com/yaocccc/nvim-hl-mdcodeblock.lua
- Owner: yaocccc
- License: mit
- Created: 2023-04-27T08:11:34.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-04-29T10:44:56.000Z (over 1 year ago)
- Last Synced: 2024-07-31T20:43:26.025Z (3 months ago)
- Language: Lua
- Size: 123 KB
- Stars: 36
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
- awesome-neovim - yaocccc/nvim-hl-mdcodeblock.lua - Highlight markdown codeblock using Tree-sitter. (Programming Languages Support / Markdown and LaTeX)
README
# HIGHLIGHT MARKDOWN CODEBLOCK
JUST DO HIGHLIGHT MARKDOWN CODEBLOCK
![show](show.png)
## REQUIRE
1. nvim version >= 0.9.0
2. nvim-treesitter## USAGE
```lua
-- packer
require('packer').startup({
-- ...
use {
'yaocccc/nvim-hl-mdcodeblock.lua',
after = 'nvim-treesitter',
config = function ()
require('hl-mdcodeblock').setup({
-- option
})
end
}
})
```## OPTION
```lua
{
hl_group = "MDCodeBlock", -- default highlight group
events = { -- refresh event
"FileChangedShellPost",
"Syntax",
"TextChanged",
"TextChangedI",
"InsertLeave",
"WinScrolled",
"BufEnter",
},
padding_right = 4, -- always append 4 space at lineend
timer_delay = 20, -- refresh delay(ms)
query_by_ft = { -- special parser query by filetype
markdown = { -- filetype
'markdown', -- parser
'(fenced_code_block) @codeblock', -- query
},
rmd = { -- filetype
'markdown', -- parser
'(fenced_code_block) @codeblock', -- query
},
},
minumum_len = 100, -- minimum len to highlight (number | function)
-- minumum_len = function () return math.max(math.floor(vim.api.nvim_win_get_width(0) * 0.8), 100) end
}
```