mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-08 11:03:47 -05:00
Issue #244
Test with next VIMRC settings:
let g:table_mode_color_cells = 1
function! g:TableModeColorCellsCustom()
let g:TableModeSyntaxDict.contains .= ',highPriorityCell,completeCell,infoCell'
syntax match highPriorityCell /|\@<= *\![^|]*/ contained
syntax match completeCell /|\@<= *X[^|]*/ contained
syntax match infoCell /|\@<= *\/\/[^|]*/ contained
endfunction
autocmd VimEnter * call timer_start(10, {-> g:TableModeColorCellsCustom()})
This commit is contained in:
@@ -69,10 +69,10 @@ function! s:ToggleSyntax() "{{{2
|
|||||||
if !g:table_mode_syntax | return | endif
|
if !g:table_mode_syntax | return | endif
|
||||||
|
|
||||||
if tablemode#IsActive()
|
if tablemode#IsActive()
|
||||||
exec 'syntax match Table'
|
execute 'syntax match Table'
|
||||||
\ '/' . tablemode#table#StartExpr() . '\zs|.\+|\ze' . tablemode#table#EndExpr() . '/'
|
\ '/' . tablemode#table#StartExpr() . '\zs|.\+|\ze' . tablemode#table#EndExpr() . '/'
|
||||||
\ 'contains=TableBorder,TableSeparator,TableColumnAlign,yesCell,noCell,maybeCell,redCell,greenCell,yellowCell,blueCell,whiteCell,darkCell'
|
\ 'contains=' . g:TableModeSyntaxDict.contains
|
||||||
\ 'containedin=ALL'
|
\ 'containedin=' . g:TableModeSyntaxDict.containedin
|
||||||
syntax match TableSeparator /|/ contained
|
syntax match TableSeparator /|/ contained
|
||||||
syntax match TableColumnAlign /:/ contained
|
syntax match TableColumnAlign /:/ contained
|
||||||
syntax match TableBorder /[\-+]\+/ contained
|
syntax match TableBorder /[\-+]\+/ contained
|
||||||
|
|||||||
@@ -132,5 +132,12 @@ augroup END
|
|||||||
" Avoiding side effects {{{1
|
" Avoiding side effects {{{1
|
||||||
let &cpo = s:save_cpo
|
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 {{{
|
" ModeLine {{{
|
||||||
" vim: sw=2 sts=2 fdl=0 fdm=marker
|
" vim: sw=2 sts=2 fdl=0 fdm=marker
|
||||||
|
|||||||
Reference in New Issue
Block a user