You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find it useful to only show tab via listchars when using spaces and vice versa, since that allows me to quickly identify the use of the wrong type of indention in a file.
Currently, I run a simple autocommand like this to adjust listchars depending whether the buffer uses tabs or spaces:
autocmd("BufReadPost", {
callback=function()
-- defered, to ensure it runs after `:GuessIndent`vim.defer_fn(function()
opt_local.listchars=vim.opt_global.listchars:get() -- copy the globalifbo.expandtabthenopt_local.listchars:append { tab="? " }
opt_local.listchars:append { lead="" }
elseopt_local.listchars:append { tab="" }
opt_local.listchars:append { lead="�" }
endend, 5)
end,
})
I was thinking that adjusting listchars would actually make a lot of sense for in the context of this plugin (and would also save one from using hacky solutions like deferring that autocmd)
The text was updated successfully, but these errors were encountered:
I find it useful to only show tab via
listchars
when using spaces and vice versa, since that allows me to quickly identify the use of the wrong type of indention in a file.Currently, I run a simple autocommand like this to adjust
listchars
depending whether the buffer uses tabs or spaces:I was thinking that adjusting
listchars
would actually make a lot of sense for in the context of this plugin (and would also save one from using hacky solutions like deferring that autocmd)The text was updated successfully, but these errors were encountered: