From 5b3b2f7c05e1b95794dafc6d91d15c9105aa8b79 Mon Sep 17 00:00:00 2001 From: Dhruva Sagar Date: Wed, 21 Sep 2016 14:05:56 +0530 Subject: [PATCH] Updated the README Fixed the tip --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a096e14..4c90a15 100644 --- a/README.md +++ b/README.md @@ -34,19 +34,19 @@ To start using the plugin in the on-the-fly mode use `:TableModeToggle` mapped t > You can use the following to quickly enable / disable table mode in insert > mode by using `||` or `__` : > ```vim -> inoreabbrev -> \ s:isAtStartOfLine('\|\|') ? -> \ ':TableModeEnable' : '' -> inoreabbrev __ -> \ s:isAtStartOfLine('__') ? -> \ ':silent! TableModeDisable' : '__' -> -> fun! s:isAtStartOfLine(mapping) +> function! s:isAtStartOfLine(mapping) > let text_before_cursor = getline('.')[0 : col('.')-1] > let mapping_pattern = '\V' . escape(a:mapping, '\') > let comment_pattern = '\V' . escape(substitute(&l:commentstring, '%s.*$', '', ''), '\') > return (text_before_cursor =~? '^' . ('\v(' . comment_pattern . '\v)?') . '\s*\v' . mapping_pattern . '\v$') -> endf +> endfunction +> +> inoreabbrev +> \ isAtStartOfLine('\|\|') ? +> \ ':TableModeEnable' : '' +> inoreabbrev __ +> \ isAtStartOfLine('__') ? +> \ ':silent! TableModeDisable' : '__' > ``` Enter the first line, delimiting columns by the `|` symbol. The plugin reacts by inserting spaces between the text and the separator if you omit them: