shellRaining / hlchunk.nvim

This is the lua implementation of nvim-hlchunk, you can use this neovim plugin to highlight your indent line and the current chunk (context) your cursor stayed
MIT License
472 stars 29 forks source link

Hide colorcolumn when not needed #89

Closed hinell closed 1 month ago

hinell commented 5 months ago

I think it would be nice to make hiding colorcolumn configurable. See demo below:

demo

Taken from smartcolumn.nvim

shellRaining commented 2 months ago

good idea, I will take a look

daUnknownCoder commented 1 month ago

good idea, I will take a look

unnecessary if using Bekaboo/deadcolumn.nvim

hinell commented 1 month ago

@daUnknownCoder Have you used it in practice? Wonder if it doesn't conflict with hlchunk. Thanks.

shellRaining commented 1 month ago

hlchunk sets the range of the mark very limited, it should not affect other plugins.

and because this feat will add a new mod, please give me some time to consider how to implement it. Maybe a few weeks... I'm now try my best to improve the performance of existing mods

daUnknownCoder commented 1 month ago

@daUnknownCoder Have you used it in practice? Wonder if it doesn't conflict with hlchunk. Thanks.

i use both and it is very good:

My hlchunk+deadcolumn config !click me `hlchunk`: ```lua { "shellRaining/hlchunk.nvim", event = { "LazyFile" }, lazy = true, dependencies = { { "https://gitlab.com/HiPhish/rainbow-delimiters.nvim", name = "rainbow-delimiters.nvim", url = "https://gitlab.com/HiPhish/rainbow-delimiters.nvim", event = "VeryLazy", lazy = true, }, }, config = function() local hlchunk_status_ok, hlchunk = pcall(require, "hlchunk") if not hlchunk_status_ok then print("hlchunk not found!") end hlchunk.setup({ chunk = { enable = true, priority = 15, notify = true, style = { "#5ef33e", "#c21f30", }, chars = { horizontal_line = "─", vertical_line = "│", left_top = "╭", left_bottom = "╰", right_arrow = ">", }, textobject = "ic", duration = 250, error_sign = true, exclude_filetypes = { aerial = true, dashboard = true, fidget = true, NvimTree = true, TelescopePrompt = true, cmp = true, cmp_docs = true, }, }, indent = { enable = true, chars = { "▎", }, style = { "#E06C75", "#E5C07B", "#61AFEF", "#D19A66", "#98C379", "#C678DD", "#56B6C2", }, exclude_filetypes = { aerial = true, dashboard = true, fidget = true, NvimTree = true, TelescopePrompt = true, cmp = true, cmp_docs = true, }, }, line_num = { enable = true, style = "#C678DD", exclude_filetypes = { aerial = true, dashboard = true, fidget = true, NvimTree = true, TelescopePrompt = true, cmp = true, cmp_docs = true, }, }, blank = { enable = false }, }) local rainbow_delimiters_status_ok, rainbow_delimiters = pcall(require, "rainbow-delimiters") if not rainbow_delimiters_status_ok then print("rainbow-delimiters not found!") end vim.g.rainbow_delimiters = { strategy = { [""] = rainbow_delimiters.strategy["global"], vim = rainbow_delimiters.strategy["local"], commonlisp = rainbow_delimiters.strategy["local"], html = rainbow_delimiters.strategy["local"], latex = function(bufnr) local line_count = vim.api.nvim_buf_line_count(bufnr) if line_count > 10000 then return nil elseif line_count > 1000 then return rainbow_delimiters.strategy["global"] end return rainbow_delimiters.strategy["local"] end, }, query = { [""] = "rainbow-delimiters", lua = "rainbow-blocks", latex = "rainbow-blocks", query = function(bufnr) local is_nofile = vim.bo[bufnr].buftype == "nofile" return is_nofile and "rainbow-blocks" or "rainbow-delimiters" end, }, priority = { [""] = 110, lua = 210, }, highlight = { "RainbowDelimiterRed", "RainbowDelimiterYellow", "RainbowDelimiterBlue", "RainbowDelimiterOrange", "RainbowDelimiterGreen", "RainbowDelimiterViolet", "RainbowDelimiterCyan", }, } end, }, ``` `deadcolumn`: ```lua { "Bekaboo/deadcolumn.nvim", lazy = true, event = { "LazyFile" }, config = function() require("deadcolumn").setup({ scope = "line", blending = { threshold = 0.75, colorcode = "#000000", hlgroup = { "Normal", "bg" }, }, warning = { alpha = 0.4, offset = 0, colorcode = "#FF0000", hlgroup = { "Error", "bg" }, }, }) end, }, ```

how it looks: image image

hinell commented 1 month ago

@shellRaining It's not mandatory to have this feature. Hlchunk is perfect enough and my proposal is just an idea to consider. Best. :wink:

shellRaining commented 1 month ago

😄 glad that you like this plugin, I feel that this feature is very good, and I will try to implement a version when I have the need! close temporarily