Home

Awesome

Elastic Tabstops for Neovim

This is a hack implementation of Elastic Tabstops for Neovim.

It's a hack because:

  1. 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.
  2. The plugin hides the ^I with an overlay extmark and then add the dynamic spacing using an inline extmark.
  3. The extmarks are build on every change. I might improve this later if needed.

Check :help api-extended-marks for more information about extmarks

Installation

lazy.nvim

return {
 "lsvmello/elastictabstops.nvim",
 cmds = { "ElasticTabstopsEnable", "ElasticTabstopsDisable" }
 config = true,
}

packer.nvim

use {
 "lsvmello/elastictabstops.nvim",
 config = function() require('elastictabstops').setup() end
}

Usage

Execute :ElasticTabstopsEnable to enable elastic tabstops on the current buffer.

Execute :ElasticTabstopsDisable to disable elastic tabstops on the current buffer.