Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Darazaki/indent-o-matic
Dumb automatic fast indentation detection for Neovim written in Lua
https://github.com/Darazaki/indent-o-matic
neovim neovim-lua neovim-plugin
Last synced: 14 days ago
JSON representation
Dumb automatic fast indentation detection for Neovim written in Lua
- Host: GitHub
- URL: https://github.com/Darazaki/indent-o-matic
- Owner: Darazaki
- License: mit
- Created: 2021-09-18T15:05:49.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-03T18:28:47.000Z (over 1 year ago)
- Last Synced: 2024-07-31T20:51:48.146Z (3 months ago)
- Topics: neovim, neovim-lua, neovim-plugin
- Language: Lua
- Homepage:
- Size: 47.9 KB
- Stars: 173
- Watchers: 2
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-neovim - Darazaki/indent-o-matic - Dumb automatic fast indentation detection written in Lua. (Formatting / Indent)
README
# indent-o-matic
Dumb automatic fast indentation detection for Neovim written in Lua
## How it works
Instead of trying to be smart about detecting an indentation using statistics,
it will find the first thing that looks like a standard indentation (tab or 8/4/2 spaces)
and assume that's what the file's indentation isThis has the advantage of being fast and very often correct while being simple enough
that most people will understand what it will do predictably## Requirements
- Neovim >= 0.4.4
## Installation
Can be installed through any standard Vim package manager, configuration is optional
E.g. through [vim-plug](https://github.com/junegunn/vim-plug):
```vim
call plug#begin()
Plug 'Darazaki/indent-o-matic'
call plug#end()
```Then restart Neovim and run `:PlugInstall`
## Configuration
Configuration is done in Lua:
```lua
require('indent-o-matic').setup {
-- The values indicated here are the defaults-- Number of lines without indentation before giving up (use -1 for infinite)
max_lines = 2048,-- Space indentations that should be detected
standard_widths = { 2, 4, 8 },-- Skip multi-line comments and strings (more accurate detection but less performant)
skip_multiline = true,
}
```You can also directly configure it from a Vim file by using the `lua` instruction:
```vim
lua <