Added syntax for matching tables

This commit is contained in:
Dhruva Sagar
2014-05-03 02:19:19 +05:30
parent 13e1a20002
commit 8d3c4912a2
4 changed files with 23 additions and 3 deletions

View File

@@ -50,6 +50,23 @@ function! s:TableEchoCell() "{{{1
endif
endfunction
function! s:EnableTableSyntax() "{{{1
syntax match Table /^\s*|.\+|\s*$/ 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()
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 .