English | 简体中文
similar to indent-blankline, this plugin can highlight the indent line, and highlight the code chunk according to the current cursor position.
- more extensible
- faster rendering speed (0.04 seconds per thousand renderings, with a line height of 50 lines)
- more active maintenance (the author is a student with a lot of time to maintain this plugin, haha)
this plugin now have five parts (future will add more... ^v^
)
- chunk
- indent
- line_num
- blank
- context (experimental)
one picture to understand what these mods do
NOTE: you can click the picture to get more information about how to configure like this
neovim version >= 0.7.0
use { "shellRaining/hlchunk.nvim" }
Plug "shellRaining/hlchunk.nvim"
{ "shellRaining/hlchunk.nvim", event = { "UIEnter" }, },
The script comes with the following defaults:
Click this Dropdown to see defaults setttings.
{
chunk = {
enable = true,
use_treesitter = true,
support_filetypes = {
"*.ts",
"*.tsx",
"*.js",
"*.jsx",
"*.html",
"*.json",
"*.go",
"*.c",
"*.cpp",
"*.rs",
"*.h",
"*.hpp",
"*.lua",
"*.vue",
},
chars = {
horizontal_line = "─",
vertical_line = "│",
left_top = "╭",
left_bottom = "╰",
right_arrow = ">",
},
style = "#00ffff",
},
indent = {
enable = true,
use_treesitter = false,
chars = {
"│",
},
style = {
FN.synIDattr(FN.synIDtrans(FN.hlID("Whitespace")), "fg", "gui"),
},
exclude_filetype = {
dashboard = true,
help = true,
lspinfo = true,
packer = true,
checkhealth = true,
man = true,
mason = true,
NvimTree = true,
plugin = true,
},
},
line_num = {
enable = true,
support_filetypes = {
"..." -- same as chunk
},
style = "#806d9c",
},
blank = {
enable = true,
chars = {
"․",
},
style = {
vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID("Whitespace")), "fg", "gui"),
},
exclude_filetype = "...",
},
}
setup example:
require('hlchunk').setup({
indent = {
chars = { "│", "¦", "┆", "┊", },
style = {
"#8B00FF",
},
},
blank = {
enable = false,
}
})
Click this Dropdown to see Available Commands
this plugin provides some commands to switch plugin status, which are listed below
- EnableHL
- DisableHL
the two commands are used to switch the whole plugin status, when use DisableHL
, include hl_chunk
and hl_indent
will be disable
- DisableHLChunk
- EnableHLChunk
the two will control hl_chunk
- DisableHLIndent
- EnableHLIndent
the two will control hl_indent
- DisableHLLineNum
- EnableHLLineNum
the two will control hl_line_num
- DisableHLBlank
- EnableHLBlank
the two will control hl_blank