Skip to content

Wisely add "end" in Ruby, Vimscript, Lua, etc. Tree-sitter aware alternative to tpope's vim-endwise

License

Notifications You must be signed in to change notification settings

RRethy/nvim-treesitter-endwise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Untitled.mov

Quick Start

-- 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 #2 (comment) 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

About

Wisely add "end" in Ruby, Vimscript, Lua, etc. Tree-sitter aware alternative to tpope's vim-endwise

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published