Updated table syntax to get toggled with table mode

This commit is contained in:
Dhruva Sagar
2014-05-30 12:05:31 +05:30
parent e7e806916f
commit 0f1254e1fe
2 changed files with 30 additions and 14 deletions

View File

@@ -50,25 +50,12 @@ function! s:TableEchoCell() "{{{1
endif
endfunction
function! s:EnableTableSyntax() "{{{1
exec 'syntax match Table'
\ '/' . tablemode#table#StartExpr() . '\zs|.\+|\ze' . tablemode#table#EndExpr() . '/'
\ 'contains=TableBorder,TableSeparator,TableColumnAlign containedin=ALL'
syntax match TableSeparator /|/ contained
syntax match TableColumnAlign /:/ contained
syntax match TableBorder /[\-+]\+/ contained
endfunction
augroup TableMode
au!
autocmd Syntax * call <SID>EnableTableSyntax()
autocmd Syntax * if tablemode#IsActive() | call tablemode#SyntaxEnable() | endif
augroup END
hi! link TableBorder Delimiter
hi! link TableSeparator Delimiter
hi! link TableColumnAlign Type
" Define Commands & Mappings {{{1
if !g:table_mode_always_active "{{{2
exec "nnoremap <silent> " . g:table_mode_map_prefix . g:table_mode_toggle_map .