Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here


endwise.vim: wisely add "end" in ruby, endfunction/endif/more in vim script, etc

Subscribe to updates I use vim-endwise

Statistics on vim-endwise

Number of watchers on Github 648
Number of open issues 23
Average time to close an issue 3 months
Main language VimL
Average time to merge a PR 16 days
Open pull requests 7+
Closed pull requests 10+
Last commit almost 3 years ago
Repo Created about 10 years ago
Repo Last Updated almost 2 years ago
Size 58 KB
Homepage http://www.vim.or...
Organization / Authortpope
Page Updated
Do you use vim-endwise? Leave a review!
View open issues (23)
View vim-endwise activity
View on github
Fresh, new opensource launches πŸš€πŸš€πŸš€
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating vim-endwise for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)


This is a simple plugin that helps to end certain structures automatically. In Ruby, this means adding end after if, do, def and several other keywords. In Vimscript, this amounts to appropriately adding endfunction, endif, etc. There's also Bourne shell, VB (don't ask), C/C++ preprocessor, and Lua support.

A primary guiding principle in designing this plugin was that an erroneous insertion is never acceptable. The behavior is only triggered once pressing enter on the end of the line. When this happens, endwise searches for a matching end structure and only adds one if none is found.

While the goal was to make it customizable, this turned out to be a tall order. Every language has vastly different requirements. Nonetheless, for those bold enough to attempt it, you can follow the model of the autocmds in the plugin to set the three magic variables governing endwise's behavior.


If you don't have a preferred installation method, I recommend installing pathogen.vim, and then simply copy and paste:

cd ~/.vim/bundle
git clone git://


Like endwise.vim? Follow the repository on GitHub and vote for it on And if you're feeling especially charitable, follow tpope on Twitter and GitHub.


Copyright (c) Tim Pope. Distributed under the same terms as Vim itself. See :help license.

vim-endwise open issues Ask a question     (View All Issues)
  • over 3 years make two spaces for indentation not a tab.
  • over 3 years Elixir support does not work for functions
  • over 3 years Support """
  • about 4 years LaTex
  • over 4 years [Feature] Add class/module/method names after 'end' keyword
  • over 5 years Request: support for ERB
  • almost 6 years Request for Vim’s β€˜augroup’
  • over 6 years Closing latex environments
  • over 6 years Remove ending if entered manually
  • over 6 years After hit <CR>, endwise repeat the function name in the end, why?
  • over 6 years <CR> in Insert-mode breaks up changes
  • over 7 years Enter conflicts with neocomplcache
  • almost 9 years Incompatibility with autocomplpop / does not handle pumvisible()
  • about 9 years Request for javascript? :D
  • about 9 years Hitting enter inserts "<Plug>DiscretionaryEnd"
vim-endwise open pull requests (View All Pulls)
  • support the Julia language
  • Improve setup of mappings
  • Add SQL initial support
  • Add support for blade
  • Make mappings silent.
  • Support CMake scripts
  • Adjust elixir addition to handle anonymous functions
vim-endwise list of languages used
  • Vim script
Other projects in VimL