Compare commits

...

5 Commits

Author SHA1 Message Date
Dhruva Sagar
4e41af8e5f Remove Auto Align in insert mode #115
Since realigning doesn't work well in insert mode, I have removed auto
align feature for it. Auto align will now kick in once you have made
changes and get back to normal mode.
2017-04-20 10:08:18 +05:30
Dhruva Sagar
35b41e0822 Merge pull request #113 from lbischof/patch-1
Fix readme formatting
2017-04-03 10:11:58 +05:30
Lorenz Bischof
f5d4b4e46d Fix readme formatting 2017-04-02 18:17:55 +02:00
Dhruva Sagar
d4cb68e8e1 Fix for option g:table_mode_update_time 2017-03-10 06:51:47 +05:30
Dhruva Sagar
79bf3f9bb7 Add configuration option table_mode_update_time #73
This is for better experience with auto align, we override the
updatetime with the value of the configuration g:table_mode_update_time.

Once table mode is disabled prior defaults are restored.
2017-03-10 06:48:30 +05:30
5 changed files with 25 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
# VIM Table Mode v4.6.5 [![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.6.7 [![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.
@@ -17,10 +17,11 @@ There are several ways to do this
href="https://github.com/tpope/vim-pathogen">pathogen.vim</a>, then
add a git submodule for your plugin:
```sh
```sh
$ cd ~/.vim
$ git submodule add git@github.com:dhruvasagar/vim-table-mode.git bundle/table-mode
```
```
3. Copy all files under autoload/, plugin/, doc/ to respective
~/.vim/autoload/, ~/.vim/plugin and ~/.vim/doc under UNIX or
vimfiles/autoload/, vimfiles/plugin/ and vimfiles/doc under WINDOWS and

View File

@@ -98,18 +98,28 @@ function! s:ToggleAutoAlign() "{{{2
augroup TableModeAutoAlign
au!
autocmd CursorHold,CursorHoldI * nested silent! call tablemode#table#Realign('.')
autocmd CursorHold <buffer> nested silent! call tablemode#table#Realign('.')
augroup END
else
silent! augroup! TableModeAutoAlign
endif
endfunction
function! s:ToggleOptions() "{{{2
if tablemode#IsActive()
let b:old_update_time = &updatetime
exec 'set updatetime='.g:table_mode_update_time
else
exec 'set updatetime='.get(b:, 'old_update_time', 4000)
endif
endfunction
function! s:SetActive(bool) "{{{2
let b:table_mode_active = a:bool
call s:ToggleSyntax()
call s:ToggleMapping()
call s:ToggleAutoAlign()
call s:ToggleOptions()
if tablemode#IsActive()
doautocmd User TableModeEnabled
else

View File

@@ -1,7 +1,7 @@
*table-mode.txt* Table Mode for easy table formatting
===============================================================================
Table Mode, THE AWESOME AUTOMATIC TABLE CREATOR & FORMATTER
VERSION 4.6.5
VERSION 4.6.7
Author: Dhruva Sagar <http://dhruvasagar.com/>
License: MIT <http://opensource.org/licenses/MIT/>
@@ -310,6 +310,12 @@ g:table_mode_auto_align *table-mode-auto-align*
let g:table_mode_auto_align = 1
<
g:table_mode_update_time *table-mode-update-time*
Set the value of updatetime to be used when table mode is active,
used in combination with |table-mode-auto-align|. >
let g:table_mode_update_time = 500
<
===============================================================================
MAPPINGS *table-mode-mappings*
@@ -373,7 +379,7 @@ MAPPINGS *table-mode-mappings*
|| Expands to a header border. You can change this by changing
|table-mode-separator| option. You can change the character to
be used for te extreme corners of the border by changing
be used for the extreme corners of the border by changing
|table-mode-corner-corner| option.
===============================================================================

View File

@@ -46,6 +46,7 @@ call s:SetGlobalOptDefault('table_mode_sort_map', '<Leader>ts')
call s:SetGlobalOptDefault('table_mode_syntax', 1)
call s:SetGlobalOptDefault('table_mode_auto_align', 1)
call s:SetGlobalOptDefault('table_mode_update_time', 500)
function! s:TableEchoCell() "{{{1
if tablemode#table#IsRow('.')

View File

@@ -28,3 +28,4 @@ let g:table_mode_sort_map = '<Leader>ts'
let g:table_mode_syntax = 1
let g:table_mode_auto_align = 1
let g:table_mode_update_time = 500