From 54b0f26dbdfb8efc0234b9c1422ea90104e5d431 Mon Sep 17 00:00:00 2001 From: Elliot Patros Date: Wed, 24 Oct 2018 20:36:07 -0700 Subject: [PATCH 1/5] added support for latex begin and end --- plugin/endwise.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin/endwise.vim b/plugin/endwise.vim index 20b4323..178aa78 100644 --- a/plugin/endwise.vim +++ b/plugin/endwise.vim @@ -72,6 +72,11 @@ augroup endwise " {{{1 \ let b:endwise_addition = 'endsnippet' | \ let b:endwise_words = 'snippet' | \ let b:endwise_syngroups = 'snipSnippet,snipSnippetHeader,snipSnippetHeaderKeyword' + autocmd FileType tex + \ let b:endwise_addition = '\="\\end" . matchstr(submatch(0), "{.*}")' | + \ let b:endwise_words = 'begin' | + \ let b:endwise_pattern = '\\begin{\w*}' | + \ let b:endwise_syngroups = 'texSection,texBeginEnd,texBeginEndName,texStatement' autocmd FileType * call s:abbrev() augroup END " }}}1 From 2cd91409b9c972f5bd11b9b857bfef4c13f13e6b Mon Sep 17 00:00:00 2001 From: Elliot Patros Date: Wed, 24 Oct 2018 20:37:23 -0700 Subject: [PATCH 2/5] added support for matlab switch statements --- plugin/endwise.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/endwise.vim b/plugin/endwise.vim index 178aa78..fc41905 100644 --- a/plugin/endwise.vim +++ b/plugin/endwise.vim @@ -58,8 +58,8 @@ augroup endwise " {{{1 \ let b:endwise_syngroups = 'objcObjDef' autocmd FileType matlab \ let b:endwise_addition = 'end' | - \ let b:endwise_words = 'function,if,for' | - \ let b:endwise_syngroups = 'matlabStatement,matlabFunction,matlabConditional,matlabRepeat' + \ let b:endwise_words = 'function,if,for,switch' | + \ let b:endwise_syngroups = 'matlabStatement,matlabFunction,matlabConditional,matlabRepeat,matlabLabel' autocmd FileType htmldjango \ let b:endwise_addition = '{% end& %}' | \ let b:endwise_words = 'autoescape,block,blocktrans,cache,comment,filter,for,if,ifchanged,ifequal,ifnotequal,language,spaceless,verbatim,with' | From b10b788fb97df2f585e1d3bbc53e36353bf46dca Mon Sep 17 00:00:00 2001 From: Elliot Patros Date: Thu, 25 Oct 2018 09:37:47 -0700 Subject: [PATCH 3/5] Revert "added support for matlab switch statements" This reverts commit 2cd91409b9c972f5bd11b9b857bfef4c13f13e6b. --- plugin/endwise.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/endwise.vim b/plugin/endwise.vim index fc41905..178aa78 100644 --- a/plugin/endwise.vim +++ b/plugin/endwise.vim @@ -58,8 +58,8 @@ augroup endwise " {{{1 \ let b:endwise_syngroups = 'objcObjDef' autocmd FileType matlab \ let b:endwise_addition = 'end' | - \ let b:endwise_words = 'function,if,for,switch' | - \ let b:endwise_syngroups = 'matlabStatement,matlabFunction,matlabConditional,matlabRepeat,matlabLabel' + \ let b:endwise_words = 'function,if,for' | + \ let b:endwise_syngroups = 'matlabStatement,matlabFunction,matlabConditional,matlabRepeat' autocmd FileType htmldjango \ let b:endwise_addition = '{% end& %}' | \ let b:endwise_words = 'autoescape,block,blocktrans,cache,comment,filter,for,if,ifchanged,ifequal,ifnotequal,language,spaceless,verbatim,with' | From dae2eee6a4a198b2c0c7d69d8aaebb9d1ed3bc16 Mon Sep 17 00:00:00 2001 From: Elliot Patros Date: Thu, 25 Oct 2018 09:40:38 -0700 Subject: [PATCH 4/5] added support for begin star --- plugin/endwise.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/endwise.vim b/plugin/endwise.vim index 178aa78..164c925 100644 --- a/plugin/endwise.vim +++ b/plugin/endwise.vim @@ -73,9 +73,9 @@ augroup endwise " {{{1 \ let b:endwise_words = 'snippet' | \ let b:endwise_syngroups = 'snipSnippet,snipSnippetHeader,snipSnippetHeaderKeyword' autocmd FileType tex - \ let b:endwise_addition = '\="\\end" . matchstr(submatch(0), "{.*}")' | + \ let b:endwise_addition = '\="\\end" . matchstr(submatch(0), "\**{.*}")' | \ let b:endwise_words = 'begin' | - \ let b:endwise_pattern = '\\begin{\w*}' | + \ let b:endwise_pattern = '\\begin\**{\w*}' | \ let b:endwise_syngroups = 'texSection,texBeginEnd,texBeginEndName,texStatement' autocmd FileType * call s:abbrev() augroup END " }}}1 From f28c401b19fa573ec3e65244239fbf558818c012 Mon Sep 17 00:00:00 2001 From: Elliot Patros Date: Thu, 25 Oct 2018 12:50:01 -0700 Subject: [PATCH 5/5] works for begin{x*} --- plugin/endwise.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/endwise.vim b/plugin/endwise.vim index 164c925..925626e 100644 --- a/plugin/endwise.vim +++ b/plugin/endwise.vim @@ -73,9 +73,9 @@ augroup endwise " {{{1 \ let b:endwise_words = 'snippet' | \ let b:endwise_syngroups = 'snipSnippet,snipSnippetHeader,snipSnippetHeaderKeyword' autocmd FileType tex - \ let b:endwise_addition = '\="\\end" . matchstr(submatch(0), "\**{.*}")' | + \ let b:endwise_addition = '\="\\end" . matchstr(submatch(0), "{.\\{-}}")' | \ let b:endwise_words = 'begin' | - \ let b:endwise_pattern = '\\begin\**{\w*}' | + \ let b:endwise_pattern = '\\begin{.\{-}}' | \ let b:endwise_syngroups = 'texSection,texBeginEnd,texBeginEndName,texStatement' autocmd FileType * call s:abbrev() augroup END " }}}1