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

@@ -1,4 +1,7 @@
# Change Log
## Version 4.4.1
* Added syntax for matching tables
## Version 4.4.0
* Minor bug fixes
* Added feature to allow using negative indices within formulas to access rows,

View File

@@ -1,4 +1,4 @@
# VIM Table Mode v4.4.0 [![Build Status](https://travis-ci.org/dhruvasagar/vim-table-mode.png?branch=master)](https://travis-ci.org/dhruvasagar/vim-table-mode)
# VIM Table Mode v4.4.1 [![Build Status](https://travis-ci.org/dhruvasagar/vim-table-mode.png?branch=master)](https://travis-ci.org/dhruvasagar/vim-table-mode)
An awesome automatic table creator & formatter allowing one to create neat
tables as you type.

View File

@@ -1,7 +1,7 @@
*table-mode.txt* Table Mode for easy table formatting. v4.4.0
*table-mode.txt* Table Mode for easy table formatting. v4.4.1
===============================================================================
Table Mode, THE AWESOME AUTOMATIC TABLE CREATOR & FORMATTER
VERSION 4.4.0
VERSION 4.4.1
Author: Dhruva Sagar <http://dhruvasagar.com/>
License: MIT <http://opensource.org/licenses/MIT/>

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 .