indent-blankline.nvim
indent-blankline.nvim copied to clipboard
Hide indent guides in visual mode
Hey! I've just switched from indent-guides.nvim to this plugin and one of the first thing I notice is the indent guides are displayed even in visual mode. Is there any way to hide them (lua branch)?
No it's not possible.
Neovim has virt_text_hide
which should allow this, but it's currently not working https://github.com/neovim/neovim/issues/14050#issuecomment-801536916
Hm, virt_text_hide=true
works in the neovim test suite, but only because col
is always greater than 0. The reason why it doesn't work here is because col
is 0 (if set to 1 it does, but of course everything is shifted and empty lines don't render virttext).
Now why is this happening? No clue. I couldn't find any mention of column 0 affecting virttext options in the neovim issues so either they don't know it or I have failed at searching.
You're right, it's only broken for col
0
You should comment that in the issue above, or make a new one
Yeah, I created a new issue because it 's not really related to scrolling. See https://github.com/neovim/neovim/issues/14929. Also, I noticed you @mentioned bfredl in your issue after creating it, should we do the same here?
bfredl wrote all of this virtual text code. He knows best how to fix it. Up to you if you want to tag him, he'll probably see it anyway.
hey, everyone... I'm seeing this problem with block-visual (:help CTRL-V
) with v3 and current options:
{
indent = {
char = '┆',
highlight = {"…"}
},
scope = {show_start = false}
}
ended up using the following snippet to turn on/off indent-blanklines when exiting/entering visual mode
local saca_de_enmedio_a_indent_blankline = vim.api.nvim_create_augroup("saca_de_enmedio_a_indent_blankline",
{clear = true})
vim.api.nvim_create_autocmd("ModeChanged",
{
group = saca_de_enmedio_a_indent_blankline,
pattern = "[vV\x16]*:*", -- visual → cualquier cosa
command = "IBLEnable",
desc = "Habilita indent-blanklines al salir de modo visual"
})
vim.api.nvim_create_autocmd("ModeChanged",
{
group = saca_de_enmedio_a_indent_blankline,
pattern = "*:[vV\x16]*", -- cualquier cosa → visual
command = "IBLDisable",
desc = "Deshabilita indent-blanklines al salir de modo visual"
})
This is a related question. How can I configure the plugin to never hide indent guides?
ended up using the following snippet to turn on/off indent-blanklines when exiting/entering visual mode
local saca_de_enmedio_a_indent_blankline = vim.api.nvim_create_augroup("saca_de_enmedio_a_indent_blankline", {clear = true}) vim.api.nvim_create_autocmd("ModeChanged", { group = saca_de_enmedio_a_indent_blankline, pattern = "[vV\x16]*:*", -- visual → cualquier cosa command = "IBLEnable", desc = "Habilita indent-blanklines al salir de modo visual" }) vim.api.nvim_create_autocmd("ModeChanged", { group = saca_de_enmedio_a_indent_blankline, pattern = "*:[vV\x16]*", -- cualquier cosa → visual command = "IBLDisable", desc = "Deshabilita indent-blanklines al salir de modo visual" })
This is perfect!
Here's an English version I made for myself 😅:
local indent_blankline_augroup = vim.api.nvim_create_augroup("indent_blankline_augroup", {clear = true})
vim.api.nvim_create_autocmd("ModeChanged", {
group = indent_blankline_augroup,
pattern = "[vV\x16]*:*",
command = "IBLEnable",
desc = "Enable indent-blankline when exiting visual mode"
})
vim.api.nvim_create_autocmd("ModeChanged", {
group = indent_blankline_augroup,
pattern = "*:[vV\x16]*",
command = "IBLDisable",
desc = "Disable indent-blankline when exiting visual mode"
})