This is a hack implementation of Elastic Tabstops for Neovim.
It's a hack because:
- I couldn't find a way to get the "rendered line" and Neovim adds a different spacing for tabs. Then I took advantage of setting
lcs-tab
as nil then Neovim always render it as^I
. - The plugin hides the
^I
with an overlay extmark and then add the dynamic spacing using an inline extmark. - The extmarks are build on every change. I might improve this later if needed.
Check :help api-extended-marks
for more information about extmarks
return {
"lsvmello/elastictabstops.nvim",
cmds = { "ElasticTabstopsEnable", "ElasticTabstopsDisable" }
config = true,
}
use {
"lsvmello/elastictabstops.nvim",
config = function() require('elastictabstops').setup() end
}
Execute :ElasticTabstopsEnable
to enable elastic tabstops on the current buffer.
Execute :ElasticTabstopsDisable
to disable elastic tabstops on the current buffer.