nvimdev / indentmini.nvim

A minimal and blazing fast indentline plugin
MIT License
171 stars 12 forks source link

Add multi-color indent #10

Closed KingEdwardI closed 6 months ago

KingEdwardI commented 6 months ago

Hi, I was just integrating this into my config and wanted the same thing that was mentioned in #3, I figured out a couple ways to do it, I like this one the best since it's more extensible.

This allows you to pass in a table of as many highlight groups as you want and it will set them for each indent column automatically.

Example ➡️ ```lua use({ 'KingEdwardI/indentmini.nvim', branch = 'multi-color-indents', config = function() local setColors = function() local hi_colors = { 'guifg=#AD7021', 'guifg=#8887C3', 'guifg=#738A05', 'guifg=#5F819D', 'guifg=#9E8FB2', 'guifg=#907AA9', 'guifg=#CDA869', 'guifg=#8F9D6A', } for i, val in pairs(hi_colors) do vim.cmd.highlight('IndentLine' .. i .. ' ' .. val) end end vim.api.nvim_create_autocmd('ColorScheme', { pattern = '*', callback = setColors, }) setColors() require('indentmini').setup() end, }) ``` ![Screen Shot 2024-02-22 at 7 48 41 PM](https://github.com/nvimdev/indentmini.nvim/assets/20171781/f68836b1-7a6b-447c-be64-dc1188a5fc6f)

Let me know what you think and if I should make any updates. Great plugin, thanks!

Apologies for the long string of junk commits 😬 😬

glepnir commented 6 months ago

seems good now.