diff --git a/autoload/tablemode.vim b/autoload/tablemode.vim index d601634..2dfb841 100644 --- a/autoload/tablemode.vim +++ b/autoload/tablemode.vim @@ -69,10 +69,10 @@ function! s:ToggleSyntax() "{{{2 if !g:table_mode_syntax | return | endif if tablemode#IsActive() - exec 'syntax match Table' - \ '/' . tablemode#table#StartExpr() . '\zs|.\+|\ze' . tablemode#table#EndExpr() . '/' - \ 'contains=TableBorder,TableSeparator,TableColumnAlign,yesCell,noCell,maybeCell,redCell,greenCell,yellowCell,blueCell,whiteCell,darkCell' - \ 'containedin=ALL' + execute 'syntax match Table' + \ '/' . tablemode#table#StartExpr() . '\zs|.\+|\ze' . tablemode#table#EndExpr() . '/' + \ 'contains=' . g:TableModeSyntaxDict.contains + \ 'containedin=' . g:TableModeSyntaxDict.containedin syntax match TableSeparator /|/ contained syntax match TableColumnAlign /:/ contained syntax match TableBorder /[\-+]\+/ contained diff --git a/plugin/table-mode.vim b/plugin/table-mode.vim index 1b74dc5..72409b1 100644 --- a/plugin/table-mode.vim +++ b/plugin/table-mode.vim @@ -132,5 +132,12 @@ augroup END " Avoiding side effects {{{1 let &cpo = s:save_cpo +" ToggleSyntax {{{1 +let g:TableModeSyntaxDict = { +\ 'contains': 'TableBorder,TableSeparator,TableColumnAlign,' . +\ 'yesCell,noCell,maybeCell,redCell,greenCell,yellowCell,blueCell,whiteCell,darkCell', +\ 'containedin': 'ALL' +\} + " ModeLine {{{ " vim: sw=2 sts=2 fdl=0 fdm=marker