" endwise.vim - EndWise
" Author: Tim Pope
" Version: 1.0
" License: Same as Vim itself. See :help license
" GetLatestVimScripts: 2386 1 :AutoInstall: endwise.vim
if exists("g:loaded_endwise") || &cp
finish
endif
let g:loaded_endwise = 1
augroup endwise " {{{1
autocmd!
autocmd FileType lua
\ let b:endwise_addition = '\=submatch(0)=="{" ? "}" : "end"' |
\ let b:endwise_words = 'function,do,then' |
\ let b:endwise_pattern = '^\s*\zs\%(function\|do\|then\)\>\%(.*[^.:@$]\\)\@!\|\DiscretionaryEnd") == ""
inoremap DiscretionaryEnd =crend(0)
inoremap AlwaysEnd =crend(1)
imap