Wisely add "end" in Ruby, Vimscript, Lua, etc. Tree-sitter aware alternative to tpope's vim-endwise
  • Ruby 63.5%
  • Tree-sitter Query 18.5%
  • Lua 18%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-12-29 03:27:43 -08:00
.github/ISSUE_TEMPLATE Update bug_report.md 2022-03-09 14:02:00 -05:00
lua Ignore errors in unloaded buffers (#52) 2025-08-15 17:57:31 -04:00
plugin " -> ' 2022-01-21 01:16:36 -05:00
queries fix(julia): fix let queries (#55) 2025-12-29 03:27:43 -08:00
tests Migrate from nvim-treesitter module APIs to stable Neovim treesitter APIs (#51) 2025-08-14 17:58:04 -04:00
.editorconfig Implement basic endwise with remapping <CR> 2022-01-20 23:55:16 -05:00
LICENSE Create LICENSE 2022-01-22 17:08:48 -05:00
README.md Support not using deprecated treesitter modules 2025-02-09 13:41:45 -05:00

nvim-treesitter-endwise

wisely add "end" in Ruby, Lua, Vimscript, etc.

https://user-images.githubusercontent.com/21000943/150613732-442589e2-6b08-4b14-b0a3-47effef0eb28.mov

Quick Start

No configuration is required, just install the plugin and it'll work!

About

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