Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rrethy/nvim-treesitter-endwise
Wisely add "end" in Ruby, Vimscript, Lua, etc. Tree-sitter aware alternative to tpope's vim-endwise
https://github.com/rrethy/nvim-treesitter-endwise
neovim neovim-plugin tree-sitter treesitter
Last synced: about 21 hours ago
JSON representation
Wisely add "end" in Ruby, Vimscript, Lua, etc. Tree-sitter aware alternative to tpope's vim-endwise
- Host: GitHub
- URL: https://github.com/rrethy/nvim-treesitter-endwise
- Owner: RRethy
- License: mit
- Created: 2021-12-11T01:55:36.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-07-17T16:14:25.000Z (6 months ago)
- Last Synced: 2025-01-26T13:06:40.028Z (about 21 hours ago)
- Topics: neovim, neovim-plugin, tree-sitter, treesitter
- Language: Ruby
- Homepage:
- Size: 56.6 KB
- Stars: 367
- Watchers: 5
- Forks: 22
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
nvim-treesitter-endwisewisely add "end" in Ruby, Lua, Vimscript, etc.
https://user-images.githubusercontent.com/21000943/150613732-442589e2-6b08-4b14-b0a3-47effef0eb28.mov
# Quick Start
```lua
-- Requires nvim-treesitter installed
require('nvim-treesitter.configs').setup {
endwise = {
enable = true,
},
}
```This is a simple plugin that helps to end certain structures automatically. In Ruby, this means adding end after if, do, def, etc. This even works for languages nested inside other, such as Markdown with a Lua code block!
**Supported Languages**: *Ruby*, *Lua*, *Vimscript*, *Bash*, *Elixir*, *Fish*, *Julia*
# Additional Language Support
Please open an issue for new languages, right now I'm open PRs but I won't be implementing other languages myself (except for maybe shell script). See https://github.com/RRethy/nvim-treesitter-endwise/issues/2#issuecomment-1019574925 for more information on adding support for a new language.
# Credit
This is just a rewrite of https://github.com/tpope/vim-endwise to leverage Treesitter so it can be more accurate and work without having to run Neovim's slow regex based highlighting along with nvim-treesitter highlighting.
Special thanks to
* [@jasonrhansen](https://www.github.com/jasonrhansen) who added support for injected languages and Vimscript.
* [@simonmandlik](https://www.github.com/simonmandlik) who added support for Julia.