mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-09 03:23:47 -05:00
Releasing v2.1.3
- Fixed #1. Added new option `g:table_mode_no_border_padding` which if set to 1 (set to 0 by default) removes the padding around borders (and the text too), sets `g:table_mode_align` to `'c0'` for achieving the same.
This commit is contained in:
@@ -4,6 +4,10 @@ An awesome automatic table creator & formatter allowing one to create neat
|
|||||||
tables as you type.
|
tables as you type.
|
||||||
|
|
||||||
## Change Log
|
## Change Log
|
||||||
|
### Version 2.1.3 :
|
||||||
|
* Bug Fix #1, added new option `g:table_mode_no_border_padding` which removes
|
||||||
|
padding from the border.
|
||||||
|
|
||||||
### Version 2.1.2 :
|
### Version 2.1.2 :
|
||||||
* Bug Fixes #2, #3 & #4
|
* Bug Fixes #2, #3 & #4
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
" Author: Dhruva Sagar <http://dhruvasagar.com/>
|
" Author: Dhruva Sagar <http://dhruvasagar.com/>
|
||||||
" License: MIT (http://www.opensource.org/licenses/MIT)
|
" License: MIT (http://www.opensource.org/licenses/MIT)
|
||||||
" Website: http://github.com/dhruvasagar/vim-table-mode
|
" Website: http://github.com/dhruvasagar/vim-table-mode
|
||||||
" Version: 2.1.2
|
" Version: 2.1.3
|
||||||
" Note: This plugin was heavily inspired by the 'CucumberTables.vim'
|
" Note: This plugin was heavily inspired by the 'CucumberTables.vim'
|
||||||
" (https://gist.github.com/tpope/287147) plugin by Tim Pope and
|
" (https://gist.github.com/tpope/287147) plugin by Tim Pope and
|
||||||
" uses a small amount of code from it.
|
" uses a small amount of code from it.
|
||||||
@@ -50,6 +50,7 @@ call s:SetGlobalOptDefault('table_mode_always_active', 0)
|
|||||||
call s:SetGlobalOptDefault('table_mode_delimiter', ',')
|
call s:SetGlobalOptDefault('table_mode_delimiter', ',')
|
||||||
call s:SetGlobalOptDefault('table_mode_tableize_map', '<Leader>T')
|
call s:SetGlobalOptDefault('table_mode_tableize_map', '<Leader>T')
|
||||||
call s:SetGlobalOptDefault('table_mode_align', 'l1')
|
call s:SetGlobalOptDefault('table_mode_align', 'l1')
|
||||||
|
call s:SetGlobalOptDefault('table_mode_no_border_padding', '0')
|
||||||
"}}}1
|
"}}}1
|
||||||
|
|
||||||
" Define Commands & Mappings {{{1
|
" Define Commands & Mappings {{{1
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
" Author: Dhruva Sagar <http://dhruvasagar.com/>
|
" Author: Dhruva Sagar <http://dhruvasagar.com/>
|
||||||
" License: MIT (http://www.opensource.org/licenses/MIT)
|
" License: MIT (http://www.opensource.org/licenses/MIT)
|
||||||
" Website: http://github.com/dhruvasagar/vim-table-mode
|
" Website: http://github.com/dhruvasagar/vim-table-mode
|
||||||
" Version: 2.1.2
|
" Version: 2.1.3
|
||||||
" Note: This plugin was heavily inspired by the 'CucumberTables.vim'
|
" Note: This plugin was heavily inspired by the 'CucumberTables.vim'
|
||||||
" (https://gist.github.com/tpope/287147) plugin by Tim Pope and
|
" (https://gist.github.com/tpope/287147) plugin by Tim Pope and
|
||||||
" uses a small amount of code from it.
|
" uses a small amount of code from it.
|
||||||
@@ -97,9 +97,15 @@ endfunction
|
|||||||
|
|
||||||
function! s:FillTableBorder() "{{{2
|
function! s:FillTableBorder() "{{{2
|
||||||
let [ current_col, current_line ] = [ col('.'), line('.') ]
|
let [ current_col, current_line ] = [ col('.'), line('.') ]
|
||||||
|
if g:table_mode_no_border_padding
|
||||||
|
silent! execute '%s/' . g:table_mode_corner . '\zs\([' .
|
||||||
|
\ g:table_mode_fillchar . ' ]*\)\ze' . g:table_mode_corner .
|
||||||
|
\ '/\=repeat("' . g:table_mode_fillchar . '", s:Strlen(submatch(0)))/g'
|
||||||
|
else
|
||||||
silent! execute '%s/' . g:table_mode_corner . ' \zs\([' .
|
silent! execute '%s/' . g:table_mode_corner . ' \zs\([' .
|
||||||
\ g:table_mode_fillchar . ' ]*\)\ze ' . g:table_mode_corner . '/\=repeat("' .
|
\ g:table_mode_fillchar . ' ]*\)\ze ' . g:table_mode_corner .
|
||||||
\ g:table_mode_fillchar . '", s:Strlen(submatch(0)))/g'
|
\ '/\=repeat("' . g:table_mode_fillchar . '", s:Strlen(submatch(0)))/g'
|
||||||
|
endif
|
||||||
call cursor(current_line, current_col)
|
call cursor(current_line, current_col)
|
||||||
endfunction
|
endfunction
|
||||||
" }}}2
|
" }}}2
|
||||||
@@ -126,6 +132,7 @@ function! tablemode#TableizeInsertMode() "{{{2
|
|||||||
let column = s:Strlen(substitute(getline('.')[0:col('.')], '[^' . g:table_mode_separator . ']', '', 'g'))
|
let column = s:Strlen(substitute(getline('.')[0:col('.')], '[^' . g:table_mode_separator . ']', '', 'g'))
|
||||||
let position = s:Strlen(matchstr(getline('.')[0:col('.')], '.*' . g:table_mode_separator . '\s*\zs.*'))
|
let position = s:Strlen(matchstr(getline('.')[0:col('.')], '.*' . g:table_mode_separator . '\s*\zs.*'))
|
||||||
if g:table_mode_border | call s:UpdateLineBorder(line('.')) | endif
|
if g:table_mode_border | call s:UpdateLineBorder(line('.')) | endif
|
||||||
|
if g:table_mode_no_border_padding && g:table_mode_align !=# 'c0' | let g:table_mode_align = 'c0' | endif
|
||||||
execute 'Tabularize/[' . g:table_mode_separator . g:table_mode_corner . ']/' . g:table_mode_align
|
execute 'Tabularize/[' . g:table_mode_separator . g:table_mode_corner . ']/' . g:table_mode_align
|
||||||
if g:table_mode_border | call s:FillTableBorder() | endif
|
if g:table_mode_border | call s:FillTableBorder() | endif
|
||||||
normal! 0
|
normal! 0
|
||||||
|
|||||||
@@ -48,15 +48,17 @@ The table mode is disabled by default and you can enter table mode using
|
|||||||
OPTIONS *table-mode-options*
|
OPTIONS *table-mode-options*
|
||||||
|
|
||||||
Overview:
|
Overview:
|
||||||
|table-mode-options-loaded| .......... Disable the plugin
|
|table-mode-options-loaded| ............. Disable the plugin
|
||||||
|table-mode-options-border| .......... Enable border
|
|table-mode-options-border| ............. Enable border
|
||||||
|table-mode-options-corner| .......... Set corner character
|
|table-mode-options-corner| ............. Set corner character
|
||||||
|table-mode-options-separator| ....... Set separator character
|
|table-mode-options-separator| .......... Set separator character
|
||||||
|table-mode-options-fillchar| ........ Set table fillchar character
|
|table-mode-options-fillchar| ........... Set table fillchar character
|
||||||
|table-mode-options-toggle-map| ...... Set table mode toggle mapping
|
|table-mode-options-toggle-map| ......... Set table mode toggle mapping
|
||||||
|table-mode-options-always-active| ... Set table mode to always enabled
|
|table-mode-options-always-active| ...... Set table mode to always enabled
|
||||||
|table-mode-options-delimiter| ....... Set the delimiter for Tableize
|
|table-mode-options-delimiter| .......... Set the delimiter for Tableize
|
||||||
|table-mode-options-align| ........... Set the text alignment for Tableize
|
|table-mode-options-align| .............. Set the text alignment for
|
||||||
|
Tableize
|
||||||
|
|table-mode-options-no-border-padding| .. Set for no border padding.
|
||||||
|
|
||||||
g:table_mode_loaded *table-mode-options-loaded*
|
g:table_mode_loaded *table-mode-options-loaded*
|
||||||
Use this option to disable the plugin: >
|
Use this option to disable the plugin: >
|
||||||
@@ -110,6 +112,15 @@ g:table_mode_align *table-mode-options-align*
|
|||||||
the tables. Go through |tabular-walkthrough| for details on how to set
|
the tables. Go through |tabular-walkthrough| for details on how to set
|
||||||
the format options for alignment. >
|
the format options for alignment. >
|
||||||
let g:table_mode_align = 'l1'
|
let g:table_mode_align = 'l1'
|
||||||
|
<
|
||||||
|
|
||||||
|
g:table_mode_no_border_padding *table-mode-options-no-border-padding*
|
||||||
|
Use this option to remove the border padding (extra spaces around the
|
||||||
|
|table-mode-options-fillchar|). >
|
||||||
|
let g:table_mode_no_border_padding = 0
|
||||||
|
<
|
||||||
|
NOTE this option changes |table-mode-options-align| to 'c0', so that
|
||||||
|
there is no extra padding around the contents.
|
||||||
===============================================================================
|
===============================================================================
|
||||||
MAPPINGS *table-mode-mappings*
|
MAPPINGS *table-mode-mappings*
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user