diff --git a/CHANGELOG.md b/CHANGELOG.md index a54c5aa..9fa4da2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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, diff --git a/README.md b/README.md index c13e914..62e0bec 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/doc/table-mode.txt b/doc/table-mode.txt index 000e2bf..0373608 100644 --- a/doc/table-mode.txt +++ b/doc/table-mode.txt @@ -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 License: MIT diff --git a/plugin/table-mode.vim b/plugin/table-mode.vim index 41938bd..0d7379e 100644 --- a/plugin/table-mode.vim +++ b/plugin/table-mode.vim @@ -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 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 " . g:table_mode_map_prefix . g:table_mode_toggle_map .