indent-guides.nvim
indent-guides.nvim copied to clipboard
Allows the user to provide their own custom char for indents.
Relates to #6.
The current code doesn’t seem to work on my side but is a good start. I made the change in the highlighting part so that we can add highlighting without defining a background color (i.e. useful when using indent characters such as │
.
Something is still missing though as I don’t see the indent anymore. Mind having a look? :)
I had try this before. you can change color of highlight . maybe you can see the char.
@glepnir Does this mean that it can be achieved with the current implementation? Is there any setting example?
Nice attempt! So far this only highlights the empty lines:
I think the non-virtual highlight is happening on line 177:
local id = vim.fn.matchadd(group,soft_pattern)
Perhaps this one could also be replaced with api.nvim_buf_set_extmark
?
My config:
lua require('indent_guides').setup({
\ indent_char = '▏';
\ indent_pretty_mode = true;
\ })
Here's what I've managed to do:
--- a/lua/indent_guides.lua
+++ b/lua/indent_guides.lua
@@ -174,7 +174,7 @@ local indent_guides_enable = function()
if column_start ~= nil then
if new_opts['indent_space_guides'] then
local soft_pattern = indent_highlight_pattern(new_opts['indent_soft_pattern'],column_start,guide_size)
- local id = vim.fn.matchadd(group,soft_pattern)
+ local id = vim.fn.matchadd('Conceal',soft_pattern,10,-1,{conceal='▏'})
table.insert(win_indent_matches[current_winid],id)
end
if new_opts['indent_tab_guides'] then
Also,
hi Conceal ctermbg=none ctermfg=white
set conceallevel=1
And ended up having this:
Conceal is a hack though (matchadd
supports Conceal
mode). Would possibly still be better to use virtual text for those highlights.
Just found this lib - https://github.com/lukas-reineke/indent-blankline.nvim - which works great but still relies on indentLine lib (which is great but uses conceal, which sucks). If you guys do port the functionality in this lib to use virtual text only (and thus leave conceal) it would make this lib much superior to the alternatives. I loved indentLine but hated that it messes up my concealing.
Just found this lib - https://github.com/lukas-reineke/indent-blankline.nvim - which works great but still relies on indentLine lib (which is great but uses conceal, which sucks). If you guys do port the functionality in this lib to use virtual text only (and thus leave conceal) it would make this lib much superior to the alternatives. I use indentLine but hate that it messes up my concealing.
the lua branch uses virtual text i think
yeah indent blankline doesn't depend on conceal anymore or on the indentline plugin and does exactly what this is trying to achieve but you have to take a look a the lua
branch, the stuff on master is for compatibility but think that will become default once 0.5 is out
I know that plugin. but there has some new idea when i have time :)