https://github.com/kg8m/vim-detect-indent
A Vim/Neovim plugin to detect indentation options automatically powered by denops.vim
https://github.com/kg8m/vim-detect-indent
indentation neovim neovim-plugin vim vim-denops vim-plugin
Last synced: about 2 months ago
JSON representation
A Vim/Neovim plugin to detect indentation options automatically powered by denops.vim
- Host: GitHub
- URL: https://github.com/kg8m/vim-detect-indent
- Owner: kg8m
- License: mit
- Created: 2022-06-25T15:29:24.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-22T14:32:25.000Z (over 1 year ago)
- Last Synced: 2025-03-22T15:24:44.692Z (over 1 year ago)
- Topics: indentation, neovim, neovim-plugin, vim, vim-denops, vim-plugin
- Language: TypeScript
- Homepage:
- Size: 229 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/denoland/deno/tree/v1.45.0)
[](https://github.com/vim/vim/tree/v9.0.1499)
[](https://github.com/neovim/neovim/tree/v0.8.0)
[](LICENSE)
[](https://github.com/kg8m/vim-detect-indent/actions/workflows/checks.yml)
# vim-detect-indent
A Vim/Neovim plugin to detect indentation options automatically powered by
[denops.vim](https://github.com/vim-denops/denops.vim).
## Usage
Once you install this plugin, indentation options will be detected
automatically.
If you want to customize its behavior, see
[the documentation](doc/vim-detect-indent.txt).
## Similar Plugins / Algorithm
There are great existing similar plugins. For example:
- [vim-findent](https://github.com/lambdalisue/vim-findent)
- [vim-sleuth](https://github.com/tpope/vim-sleuth)
- [detectindent](https://github.com/ciaranm/detectindent)
vim-detect-indent uses a simpler algorithm: it determines indentation based on
the majority of indented lines. If lines are indented with hard tabs,
`noexpandtab` will be set. If spaces are used, `expandtab` and `shiftwidth={n}`
will be applied. vim-detect-indent’s behavior is predictable due to its
straightforward algorithm. While it may not cover all indentation scenarios, it
is designed to work well in many common cases.
## Installation
For [dein.vim](https://github.com/Shougo/dein.vim) users:
```vim
call dein#add("kg8m/vim-detect-indent")
```
For [vim-plug](https://github.com/junegunn/vim-plug) users:
```vim
Plug 'kg8m/vim-detect-indent'
```
## Requirements
- Deno
- denops.vim
- Vim or Neovim
Supported version of Deno, Vim, and Neovim depends on denops.vim. Please see
[denops.vim’s README](https://github.com/vim-denops/denops.vim#readme).