mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-08 11:03:47 -05:00
Improve Tableize. Fix #109.
This adds a new option `g:table_mode_tableize_auto_border` that allows to enable automatic border creation when using Tableize to create tables
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# VIM Table Mode v4.7.2 [](https://travis-ci.org/dhruvasagar/vim-table-mode)
|
# VIM Table Mode v4.7.3 [](https://travis-ci.org/dhruvasagar/vim-table-mode)
|
||||||
|
|
||||||
An awesome automatic table creator & formatter allowing one to create neat
|
An awesome automatic table creator & formatter allowing one to create neat
|
||||||
tables as you type.
|
tables as you type.
|
||||||
|
|||||||
@@ -206,9 +206,24 @@ endfunction
|
|||||||
|
|
||||||
function! tablemode#TableizeRange(...) range "{{{2
|
function! tablemode#TableizeRange(...) range "{{{2
|
||||||
let lnum = a:firstline
|
let lnum = a:firstline
|
||||||
while lnum < (a:firstline + (a:lastline - a:firstline + 1))
|
let total = (a:lastline - a:firstline + 1)
|
||||||
|
echom total
|
||||||
|
let cntr = 1
|
||||||
|
while cntr <= total
|
||||||
call s:Tableizeline(lnum, a:1)
|
call s:Tableizeline(lnum, a:1)
|
||||||
undojoin
|
undojoin
|
||||||
|
if g:table_mode_tableize_auto_border
|
||||||
|
if cntr == 1
|
||||||
|
normal! O
|
||||||
|
call tablemode#table#AddBorder('.')
|
||||||
|
normal! j
|
||||||
|
let lnum += 1
|
||||||
|
endif
|
||||||
|
normal! o
|
||||||
|
call tablemode#table#AddBorder('.')
|
||||||
|
let lnum += 1
|
||||||
|
endif
|
||||||
|
let cntr += 1
|
||||||
let lnum += 1
|
let lnum += 1
|
||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
*table-mode.txt* Table Mode for easy table formatting
|
*table-mode.txt* Table Mode for easy table formatting
|
||||||
===============================================================================
|
===============================================================================
|
||||||
Table Mode, THE AWESOME AUTOMATIC TABLE CREATOR & FORMATTER
|
Table Mode, THE AWESOME AUTOMATIC TABLE CREATOR & FORMATTER
|
||||||
VERSION 4.7.2
|
VERSION 4.7.3
|
||||||
|
|
||||||
Author: Dhruva Sagar <http://dhruvasagar.com/>
|
Author: Dhruva Sagar <http://dhruvasagar.com/>
|
||||||
License: MIT <http://opensource.org/licenses/MIT/>
|
License: MIT <http://opensource.org/licenses/MIT/>
|
||||||
@@ -184,6 +184,7 @@ Overview:
|
|||||||
|table-mode-syntax| ............. Control table mode syntax
|
|table-mode-syntax| ............. Control table mode syntax
|
||||||
|table-mode-auto-align| ......... Set if the table mode should auto
|
|table-mode-auto-align| ......... Set if the table mode should auto
|
||||||
align as you type
|
align as you type
|
||||||
|
|table-mode-tableize-auto-border| Set if tableize adds row borders
|
||||||
|
|
||||||
g:loaded_table_mode *table-mode-loaded*
|
g:loaded_table_mode *table-mode-loaded*
|
||||||
Use this option to disable the plugin: >
|
Use this option to disable the plugin: >
|
||||||
@@ -358,6 +359,11 @@ g:table_mode_disable_tableize_mappings *table-mode-disable-tableize-mappings*
|
|||||||
Disables mappings for tableize. >
|
Disables mappings for tableize. >
|
||||||
let g:table_mode_disable_tableize_mappings = 0
|
let g:table_mode_disable_tableize_mappings = 0
|
||||||
<
|
<
|
||||||
|
*table-mode-tableize-auto-border*
|
||||||
|
g:table_mode_tableize_auto_border
|
||||||
|
Enables adding row borders to tables when created using tableize. >
|
||||||
|
let g:table_mode_tableize_auto_border = 0
|
||||||
|
<
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
MAPPINGS *table-mode-mappings*
|
MAPPINGS *table-mode-mappings*
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ call s:SetGlobalOptDefault('table_mode_tableize_d_map', '<Leader>T')
|
|||||||
call s:SetGlobalOptDefault('table_mode_syntax', 1)
|
call s:SetGlobalOptDefault('table_mode_syntax', 1)
|
||||||
call s:SetGlobalOptDefault('table_mode_auto_align', 1)
|
call s:SetGlobalOptDefault('table_mode_auto_align', 1)
|
||||||
call s:SetGlobalOptDefault('table_mode_update_time', 500)
|
call s:SetGlobalOptDefault('table_mode_update_time', 500)
|
||||||
|
call s:SetGlobalOptDefault('table_mode_tableize_auto_border', 0)
|
||||||
|
|
||||||
function! s:TableEchoCell() "{{{1
|
function! s:TableEchoCell() "{{{1
|
||||||
if tablemode#table#IsRow('.')
|
if tablemode#table#IsRow('.')
|
||||||
|
|||||||
@@ -34,3 +34,4 @@ let g:table_mode_tableize_d_map = '<Leader>T'
|
|||||||
let g:table_mode_syntax = 1
|
let g:table_mode_syntax = 1
|
||||||
let g:table_mode_auto_align = 1
|
let g:table_mode_auto_align = 1
|
||||||
let g:table_mode_update_time = 500
|
let g:table_mode_update_time = 500
|
||||||
|
let g:table_mode_tableize_auto_border = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user