Skip to content
This repository

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

branch: master

Experimental abbreviations

Potentially a partial replacement for remapping <CR>.

References #10, #14, #19, #22.
latest commit 38541f3dbe
Tim Pope authored
Octocat-spinner-32 plugin Experimental abbreviations April 10, 2014
Octocat-spinner-32 CONTRIBUTING.markdown Extract contribution guidelines March 27, 2014
Octocat-spinner-32 README.markdown Extract contribution guidelines March 27, 2014
README.markdown

endwise.vim

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.

Installation

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://github.com/tpope/vim-endwise.git

Self-Promotion

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

License

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

Something went wrong with that request. Please try again.