How it works
Type an opening keyword and press <Enter> — vim-endwise appends the matching closer and positions the cursor in between.
Ruby
def greet → <Enter> → def greet
| (cursor here)
end
if condition → <Enter> → if condition
|
end
do → <Enter> → do
|
end
Bash / Zsh
if [ ... ]; then → <Enter> → if [ ... ]; then
|
fi
for i in ...; do → <Enter> → for i in ...; do
|
done
Vim script
function! Foo() → <Enter> → function! Foo()
|
endfunction
No configuration needed
vim-endwise detects the filetype automatically and applies the right closer. It does nothing in filetypes it doesn't recognise.