From 0b780e9ae12ba913742356f4b7cedc52d3a15220 Mon Sep 17 00:00:00 2001 From: "Andy K. Massimino" Date: Thu, 7 Nov 2019 21:38:08 -0500 Subject: [PATCH] Standardize after/ftplugins, fix #77, fix #69 --- after/ftplugin/c_matchup.vim | 11 +++++++++++ after/ftplugin/cpp_matchup.vim | 25 +++++++++++++++++++++++++ after/ftplugin/fortran_matchup.vim | 11 +++++++++++ after/ftplugin/html_matchup.vim | 6 +++++- after/ftplugin/ocaml_matchup.vim | 11 +++++++++++ after/ftplugin/ruby_matchup.vim | 10 +++++++++- after/ftplugin/tex_matchup.vim | 25 +++++++++++++++++-------- after/ftplugin/vim_matchup.vim | 11 +++++++++++ after/ftplugin/vue_matchup.vim | 2 +- after/ftplugin/xml_matchup.vim | 6 +++++- 10 files changed, 106 insertions(+), 12 deletions(-) create mode 100644 after/ftplugin/cpp_matchup.vim diff --git a/after/ftplugin/c_matchup.vim b/after/ftplugin/c_matchup.vim index acedbb6..6a6f668 100644 --- a/after/ftplugin/c_matchup.vim +++ b/after/ftplugin/c_matchup.vim @@ -1,5 +1,16 @@ +" vim match-up - even better matching pairs +" +" Maintainer: Andy Massimino +" Email: a@normed.space +" + +if !exists('g:loaded_matchup') || !exists('b:did_ftplugin') + finish +endif if matchup#util#check_match_words('bb2bcbee') call matchup#util#append_match_words('/\*:\*/') endif +" vim: fdm=marker sw=2 + diff --git a/after/ftplugin/cpp_matchup.vim b/after/ftplugin/cpp_matchup.vim new file mode 100644 index 0000000..c8575f8 --- /dev/null +++ b/after/ftplugin/cpp_matchup.vim @@ -0,0 +1,25 @@ +" vim match-up - even better matching pairs +" +" Maintainer: Andy Massimino +" Email: a@normed.space +" + +if !exists('g:loaded_matchup') || !exists('b:did_ftplugin') + finish +endif + +let s:save_cpo = &cpo +set cpo&vim + +if matchup#util#matchpref('template', 0) + call matchup#util#append_match_words( + \ '\%(\s\@\|>\s\@!\)=\@!') + if stridx(&matchpairs, '<:>') + setlocal matchpairs-=<:> + endif +endif + +let &cpo = s:save_cpo + +" vim: fdm=marker sw=2 + diff --git a/after/ftplugin/fortran_matchup.vim b/after/ftplugin/fortran_matchup.vim index 024eda6..8e3b7d4 100644 --- a/after/ftplugin/fortran_matchup.vim +++ b/after/ftplugin/fortran_matchup.vim @@ -1,3 +1,12 @@ +" vim match-up - even better matching pairs +" +" Maintainer: Andy Massimino +" Email: a@normed.space +" + +if !exists('g:loaded_matchup') || !exists('b:did_ftplugin') + finish +endif let s:save_cpo = &cpo set cpo&vim @@ -12,3 +21,5 @@ call matchup#util#append_match_words( let &cpo = s:save_cpo +" vim: fdm=marker sw=2 + diff --git a/after/ftplugin/html_matchup.vim b/after/ftplugin/html_matchup.vim index d6ee0fa..509737b 100644 --- a/after/ftplugin/html_matchup.vim +++ b/after/ftplugin/html_matchup.vim @@ -1,9 +1,13 @@ -" vim match-up - matchit replacement and more +" vim match-up - even better matching pairs " " Maintainer: Andy Massimino " Email: a@normed.space " +if !exists('g:loaded_matchup') || !exists('b:did_ftplugin') + finish +endif + let s:save_cpo = &cpo set cpo&vim diff --git a/after/ftplugin/ocaml_matchup.vim b/after/ftplugin/ocaml_matchup.vim index 0a65196..86f2732 100644 --- a/after/ftplugin/ocaml_matchup.vim +++ b/after/ftplugin/ocaml_matchup.vim @@ -1,4 +1,15 @@ +" vim match-up - even better matching pairs +" +" Maintainer: Andy Massimino +" Email: a@normed.space +" + +if !exists('g:loaded_matchup') || !exists('b:did_ftplugin') + finish +endif let b:matchup_matchparen_timeout=100 let b:undo_ftplugin .= ' | unlet! b:matchup_matchparen_timeout' +" vim: fdm=marker sw=2 + diff --git a/after/ftplugin/ruby_matchup.vim b/after/ftplugin/ruby_matchup.vim index e9f7956..411d774 100644 --- a/after/ftplugin/ruby_matchup.vim +++ b/after/ftplugin/ruby_matchup.vim @@ -1,4 +1,10 @@ -if !exists('b:did_ftplugin') +" vim match-up - even better matching pairs +" +" Maintainer: Andy Massimino +" Email: a@normed.space +" + +if !exists('g:loaded_matchup') || !exists('b:did_ftplugin') finish endif @@ -15,3 +21,5 @@ let b:undo_ftplugin .= '| unlet! b:match_midmap' let &cpo = s:save_cpo +" vim: fdm=marker sw=2 + diff --git a/after/ftplugin/tex_matchup.vim b/after/ftplugin/tex_matchup.vim index 93ad6e6..b748b7a 100644 --- a/after/ftplugin/tex_matchup.vim +++ b/after/ftplugin/tex_matchup.vim @@ -1,9 +1,13 @@ -" vim match-up - matchit replacement and more +" vim match-up - even better matching pairs " " Maintainer: Andy Massimino " Email: a@normed.space " +if !exists('g:loaded_matchup') || !exists('b:did_ftplugin') + finish +endif + let s:save_cpo = &cpo set cpo&vim @@ -71,15 +75,20 @@ function! s:get_match_words() endfunction function! s:setup_match_words() - setlocal matchpairs=(:),{:},[:] - let b:matchup_delim_nomatchpairs = 1 - let b:match_words = s:get_match_words() + setlocal matchpairs=(:),{:},[:] + let b:matchup_delim_nomatchpairs = 1 + let b:match_words = s:get_match_words() - " the syntax method is too slow for latex - let b:match_skip = 'r:\\\@