diff --git a/README.md b/README.md
index ef8605c..6f646cb 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# VIM Table Mode v4.6.4.3 [](https://travis-ci.org/dhruvasagar/vim-table-mode)
+# VIM Table Mode v4.6.4.4 [](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/autoload/tablemode.vim b/autoload/tablemode.vim
index defc3dd..4017fe9 100644
--- a/autoload/tablemode.vim
+++ b/autoload/tablemode.vim
@@ -65,7 +65,7 @@ function! s:ToggleMapping() "{{{2
endif
endfunction
-function! tablemode#SyntaxEnable()
+function! tablemode#SyntaxEnable() "{{{2
exec 'syntax match Table'
\ '/' . tablemode#table#StartExpr() . '\zs|.\+|\ze' . tablemode#table#EndExpr() . '/'
\ 'contains=TableBorder,TableSeparator,TableColumnAlign containedin=ALL'
@@ -79,6 +79,8 @@ function! tablemode#SyntaxEnable()
endfunction
function! s:ToggleSyntax()
+ if !g:table_mode_syntax | return | endif
+
if tablemode#IsActive()
call tablemode#SyntaxEnable()
else
diff --git a/doc/table-mode.txt b/doc/table-mode.txt
index 631ecdd..6892568 100644
--- a/doc/table-mode.txt
+++ b/doc/table-mode.txt
@@ -1,7 +1,7 @@
*table-mode.txt* Table Mode for easy table formatting
===============================================================================
Table Mode, THE AWESOME AUTOMATIC TABLE CREATOR & FORMATTER
- VERSION 4.6.4.3
+ VERSION 4.6.4.4
Author: Dhruva Sagar
License: MIT
@@ -169,6 +169,7 @@ Overview:
|table-mode-eval-formula-map| ... Set the eval formula mapping
|table-mode-echo-cell-map| ...... Set the echo cell mapping
|table-mode-sort-map| ........... Set the table sort mapping
+ |table-mode-syntax| ............. Control table mode syntax
g:loaded_table_mode *table-mode-loaded*
Use this option to disable the plugin: >
@@ -296,6 +297,11 @@ g:table_mode_sort_map *table-mode-sort-map*
current column. >
let g:table_mode_sort_map = 'ts'
>
+g:table_mode_syntax *table-mode-syntax*
+ Control whether table mode should define table syntax definitions or
+ not. >
+ let g:table_mode_syntax = 1
+<
===============================================================================
MAPPINGS *table-mode-mappings*
diff --git a/plugin/table-mode.vim b/plugin/table-mode.vim
index 5ba31ea..4fbb20b 100644
--- a/plugin/table-mode.vim
+++ b/plugin/table-mode.vim
@@ -44,18 +44,14 @@ call s:SetGlobalOptDefault('table_mode_eval_formula_map', 'tfe')
call s:SetGlobalOptDefault('table_mode_echo_cell_map', 't?')
call s:SetGlobalOptDefault('table_mode_sort_map', 'ts')
+call s:SetGlobalOptDefault('table_mode_syntax', 1)
+
function! s:TableEchoCell() "{{{1
if tablemode#table#IsRow('.')
echomsg '$' . tablemode#spreadsheet#RowNr('.') . ',' . tablemode#spreadsheet#ColumnNr('.')
endif
endfunction
-augroup TableMode
- au!
-
- autocmd Syntax * if tablemode#IsActive() | call tablemode#SyntaxEnable() | endif
-augroup END
-
" Define Commands & Mappings {{{1
if !g:table_mode_always_active "{{{2
exec "nnoremap " g:table_mode_map_prefix . g:table_mode_toggle_map ":call tablemode#Toggle()"
diff --git a/t/config/options.vim b/t/config/options.vim
index 99b5098..ea1d41b 100644
--- a/t/config/options.vim
+++ b/t/config/options.vim
@@ -25,3 +25,5 @@ let g:table_mode_add_formula_map = 'tfa'
let g:table_mode_eval_formula_map = 'tfe'
let g:table_mode_echo_cell_map = 't?'
let g:table_mode_sort_map = 'ts'
+
+let g:table_mode_syntax = 1