Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide colorcolumn when not needed #89

Closed
hinell opened this issue Feb 23, 2024 · 7 comments
Closed

Hide colorcolumn when not needed #89

hinell opened this issue Feb 23, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@hinell
Copy link
Contributor

hinell commented Feb 23, 2024

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

demo

Taken from smartcolumn.nvim

@shellRaining
Copy link
Owner

good idea, I will take a look

@shellRaining shellRaining added the enhancement New feature or request label May 25, 2024
@daUnknownCoder
Copy link

good idea, I will take a look

unnecessary if using Bekaboo/deadcolumn.nvim

@hinell
Copy link
Contributor Author

hinell commented Jun 13, 2024

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

@shellRaining
Copy link
Owner

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
Copy link

@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:

  {
    "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:

  {
    "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
Copy link
Contributor Author

hinell commented Jun 16, 2024

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

@shellRaining
Copy link
Owner

😄 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants