Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lsvmello/elastictabstops.nvim
https://github.com/lsvmello/elastictabstops.nvim
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lsvmello/elastictabstops.nvim
- Owner: lsvmello
- License: mit
- Created: 2024-02-06T20:29:02.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-06T20:46:37.000Z (11 months ago)
- Last Synced: 2024-08-02T18:37:00.662Z (5 months ago)
- Language: Lua
- Size: 1.95 KB
- Stars: 8
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- my-neovim-pluginlist - lsvmello/elastictabstops.nvim - commit/lsvmello/elastictabstops.nvim) ![](https://img.shields.io/github/commit-activity/y/lsvmello/elastictabstops.nvim) (Editing support / Insert)
README
# Elastic Tabstops for Neovim
This is a hack implementation of [Elastic Tabstops](https://nickgravgaard.com/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`.
1. The plugin hides the `^I` with an overlay _extmark_ and then add the dynamic spacing using an inline _extmark_.
1. 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](https://github.com/folke/lazy.nvim)
```lua
return {
"lsvmello/elastictabstops.nvim",
cmds = { "ElasticTabstopsEnable", "ElasticTabstopsDisable" }
config = true,
}
```### [packer.nvim](https://github.com/wbthomason/packer.nvim)
```lua
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.