mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-09 19:43:48 -05:00
Releasing v4.0.0
* Refactored complete code to be more modular. * Fixed long standing unicode alignment issue #8. * Testing individual components ensuring better test coverage.
This commit is contained in:
@@ -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: https://github.com/dhruvasagar/vim-table-mode
|
" Website: https://github.com/dhruvasagar/vim-table-mode
|
||||||
" Version: 3.3.3
|
" Version: 4.0.0
|
||||||
" 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.
|
" (https://gist.github.com/tpope/287147) plugin by Tim Pope.
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
|
" ============================== Header ======================================
|
||||||
|
" File: autoload/tablemode/align.vim
|
||||||
|
" Description: Table mode for vim for creating neat tables.
|
||||||
|
" Author: Dhruva Sagar <http://dhruvasagar.com/>
|
||||||
|
" License: MIT (http://www.opensource.org/licenses/MIT)
|
||||||
|
" Website: https://github.com/dhruvasagar/vim-table-mode
|
||||||
|
" Version: 4.0.0
|
||||||
|
" Note: This plugin was heavily inspired by the 'CucumberTables.vim'
|
||||||
|
" (https://gist.github.com/tpope/287147) plugin by Tim Pope.
|
||||||
|
"
|
||||||
|
" Copyright Notice:
|
||||||
|
" Permission is hereby granted to use and distribute this code,
|
||||||
|
" with or without modifications, provided that this copyright
|
||||||
|
" notice is copied with it. Like anything else that's free,
|
||||||
|
" table-mode.vim is provided *as is* and comes with no warranty
|
||||||
|
" of any kind, either expressed or implied. In no event will
|
||||||
|
" the copyright holder be liable for any damamges resulting
|
||||||
|
" from the use of this software.
|
||||||
|
" =============================================================================
|
||||||
|
|
||||||
" Borrowed from Tabular
|
" Borrowed from Tabular
|
||||||
" Private Functions {{{1
|
" Private Functions {{{1
|
||||||
" Return the number of bytes in a string after expanding tabs to spaces. {{{2
|
" Return the number of bytes in a string after expanding tabs to spaces. {{{2
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
|
" ============================== Header ======================================
|
||||||
|
" File: autoload/tablemode/spreadsheet.vim
|
||||||
|
" Description: Table mode for vim for creating neat tables.
|
||||||
|
" Author: Dhruva Sagar <http://dhruvasagar.com/>
|
||||||
|
" License: MIT (http://www.opensource.org/licenses/MIT)
|
||||||
|
" Website: https://github.com/dhruvasagar/vim-table-mode
|
||||||
|
" Version: 4.0.0
|
||||||
|
" Note: This plugin was heavily inspired by the 'CucumberTables.vim'
|
||||||
|
" (https://gist.github.com/tpope/287147) plugin by Tim Pope.
|
||||||
|
"
|
||||||
|
" Copyright Notice:
|
||||||
|
" Permission is hereby granted to use and distribute this code,
|
||||||
|
" with or without modifications, provided that this copyright
|
||||||
|
" notice is copied with it. Like anything else that's free,
|
||||||
|
" table-mode.vim is provided *as is* and comes with no warranty
|
||||||
|
" of any kind, either expressed or implied. In no event will
|
||||||
|
" the copyright holder be liable for any damamges resulting
|
||||||
|
" from the use of this software.
|
||||||
|
" =============================================================================
|
||||||
|
|
||||||
" Private Functions {{{1
|
" Private Functions {{{1
|
||||||
function! s:Sum(list) "{{{2
|
function! s:Sum(list) "{{{2
|
||||||
let result = 0.0
|
let result = 0.0
|
||||||
|
|||||||
@@ -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: https://github.com/dhruvasagar/vim-table-mode
|
" Website: https://github.com/dhruvasagar/vim-table-mode
|
||||||
" Version: 3.3.3
|
" Version: 4.0.0
|
||||||
" 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.
|
" (https://gist.github.com/tpope/287147) plugin by Tim Pope.
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
|
" ============================== Header ======================================
|
||||||
|
" File: autoload/tablemode/utils.vim
|
||||||
|
" Description: Table mode for vim for creating neat tables.
|
||||||
|
" Author: Dhruva Sagar <http://dhruvasagar.com/>
|
||||||
|
" License: MIT (http://www.opensource.org/licenses/MIT)
|
||||||
|
" Website: https://github.com/dhruvasagar/vim-table-mode
|
||||||
|
" Version: 4.0.0
|
||||||
|
" Note: This plugin was heavily inspired by the 'CucumberTables.vim'
|
||||||
|
" (https://gist.github.com/tpope/287147) plugin by Tim Pope.
|
||||||
|
"
|
||||||
|
" Copyright Notice:
|
||||||
|
" Permission is hereby granted to use and distribute this code,
|
||||||
|
" with or without modifications, provided that this copyright
|
||||||
|
" notice is copied with it. Like anything else that's free,
|
||||||
|
" table-mode.vim is provided *as is* and comes with no warranty
|
||||||
|
" of any kind, either expressed or implied. In no event will
|
||||||
|
" the copyright holder be liable for any damamges resulting
|
||||||
|
" from the use of this software.
|
||||||
|
" =============================================================================
|
||||||
|
|
||||||
" Private Functions {{{1
|
" Private Functions {{{1
|
||||||
|
|
||||||
" Public Functions {{{1
|
" Public Functions {{{1
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
*table-mode.txt* Table Mode for easy table formatting. v3.3.3
|
*table-mode.txt* Table Mode for easy table formatting. v4.0.0
|
||||||
===============================================================================
|
===============================================================================
|
||||||
Table Mode, THE AWESOME AUTOMATIC TABLE CREATOR & FORMATTER
|
Table Mode, THE AWESOME AUTOMATIC TABLE CREATOR & FORMATTER
|
||||||
VERSION 3.3.3
|
VERSION 4.0.0
|
||||||
|
|
||||||
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/>
|
||||||
@@ -137,17 +137,6 @@ Overview:
|
|||||||
|table-mode-toggle-map| ......... Set table mode toggle mapping.
|
|table-mode-toggle-map| ......... Set table mode toggle mapping.
|
||||||
|table-mode-always-active| ...... Set table mode to always enabled.
|
|table-mode-always-active| ...... Set table mode to always enabled.
|
||||||
|table-mode-delimiter| .......... Set the delimiter for Tableize.
|
|table-mode-delimiter| .......... Set the delimiter for Tableize.
|
||||||
|table-mode-tableize-map| ....... Set mapping for Tableize.
|
|
||||||
|table-mode-tableize-op-map| .... Set mapping for Tableize with input.
|
|
||||||
|table-mode-realign-map| ........ Set mapping for table realigning.
|
|
||||||
|table-mode-cell-text-object| ... Set mapping for table cell object.
|
|
||||||
|table-mode-delete-row-map| ..... Set mapping for deleting table row.
|
|
||||||
|table-mode-delete-column-map| .. Set mapping for deleting table
|
|
||||||
column.
|
|
||||||
|table-mode-add-formula-map| .... Define a new table formula for the
|
|
||||||
current cell.
|
|
||||||
|table-mode-eval-expr-map| ...... Evaluate formula line and update
|
|
||||||
table.
|
|
||||||
|table-mode-corner-corner| ...... Set the character to be used for
|
|table-mode-corner-corner| ...... Set the character to be used for
|
||||||
extreme corners of the table border.
|
extreme corners of the table border.
|
||||||
|
|
||||||
@@ -202,83 +191,6 @@ g:table_mode_delimiter *table-mode-delimiter*
|
|||||||
|table-mode-commands-tableize| >
|
|table-mode-commands-tableize| >
|
||||||
let g:table_mode_delimiter = ','
|
let g:table_mode_delimiter = ','
|
||||||
<
|
<
|
||||||
|
|
||||||
g:table_mode_tableize_map *table-mode-tableize-map*
|
|
||||||
Use this option to define the mapping to invoke |:Tableize| with
|
|
||||||
default delimiter, i.e. |:Tableize| without input. >
|
|
||||||
let g:table_mode_tableize_map = 't'
|
|
||||||
<
|
|
||||||
|
|
||||||
g:table_mode_tableize_op_map *table-mode-tableize-op-map*
|
|
||||||
Use this option to define the mapping to invoke |:Tableize| with input
|
|
||||||
parameter. This option will ask for command-line input {pattern} that
|
|
||||||
defines the delimiter. >
|
|
||||||
let g:table_mode_tableize_op_map = '<Leader>T'
|
|
||||||
<
|
|
||||||
|
|
||||||
g:table_mode_realign_map *table-mode-realign-map*
|
|
||||||
Use this option to define the mapping for realigning table columns.
|
|
||||||
This is useful in case you make edits to an existing table. >
|
|
||||||
let g:table_mode_realign_map = 'r'
|
|
||||||
<
|
|
||||||
NOTE you will need to use the |table-mode-map-prefix| before this to
|
|
||||||
get the desired effect.
|
|
||||||
|
|
||||||
g:table_mode_cell_text_object *table-mode-cell-text-object*
|
|
||||||
Use this option to define the table mode cell text object. >
|
|
||||||
let g:table_mode_cell_text_object = 'tc'
|
|
||||||
<
|
|
||||||
This text object automatically selects different text depending on the
|
|
||||||
context.
|
|
||||||
|
|
||||||
If you delete the cell using either the 'd' or the 'c'
|
|
||||||
operator, it will delete cell contents along with the table separator.
|
|
||||||
In case you do it with 'c' while you add new content for the cell, you
|
|
||||||
will have to re-add the |table-mode-separator|, which will trigger the
|
|
||||||
re-alignment of the table again and format it correctly.
|
|
||||||
|
|
||||||
If you simply want to yank the table content, this text object will
|
|
||||||
select only the table cell contents, without the padding (extra space
|
|
||||||
around the text) or the |table-mode-separator|.
|
|
||||||
|
|
||||||
g:table_mode_delete_row_map *table-mode-delete-row-map*
|
|
||||||
Use this option to define the mapping for deletion of the entire table
|
|
||||||
row. You can delete multiple rows by preceeding this with a [count]. >
|
|
||||||
let g:table_mode_delete_column_map = 'dd'
|
|
||||||
<
|
|
||||||
NOTE you will need to use the |table-mode-map-prefix| before this to
|
|
||||||
get the desired effect.
|
|
||||||
|
|
||||||
g:table_mode_delete_column_map *table-mode-delete-column-map*
|
|
||||||
Use this option to define the mapping for deletion of the entire table
|
|
||||||
column. You can delete multiple columns to the right by preceeding
|
|
||||||
this with a [count] >
|
|
||||||
let g:table_mode_delete_column_map = 'dc'
|
|
||||||
<
|
|
||||||
NOTE you will need to use the |table-mode-map-prefix| before this to
|
|
||||||
get the desired effect.
|
|
||||||
|
|
||||||
g:table_mode_add_formula_map *table-mode-add-formula-map*
|
|
||||||
Use this option to define the mapping for invoking |TableAddFormula|
|
|
||||||
command. >
|
|
||||||
let g:table_mode_add_formula_map = 'fa'
|
|
||||||
<
|
|
||||||
NOTE you will need to use the |table-mode-map-prefix| before this to
|
|
||||||
get the desired effect.
|
|
||||||
|
|
||||||
g:table_mode_eval_expr_map *table-mode-eval-expr-map*
|
|
||||||
Use this option to define the mapping for invoking
|
|
||||||
|TableEvalFormulaLine| command. >
|
|
||||||
let g:table_mode_eval_expr_map = 'fe'
|
|
||||||
<
|
|
||||||
NOTE you will need to use the |table-mode-map-prefix| before this to
|
|
||||||
get the desired effect.
|
|
||||||
|
|
||||||
g:table_mode_echo_cell_map *table-mode-echo-cell-map*
|
|
||||||
Use this option to define the mapping for echoing current cells
|
|
||||||
representation for defining formulas. >
|
|
||||||
let g:table_mode_echo_cell_map = '?'
|
|
||||||
<
|
|
||||||
g:table_mode_corner_corner *table-mode-corner-corner*
|
g:table_mode_corner_corner *table-mode-corner-corner*
|
||||||
Use this option to define the character to be used for the extreme
|
Use this option to define the character to be used for the extreme
|
||||||
corners of the table border. >
|
corners of the table border. >
|
||||||
@@ -296,8 +208,8 @@ MAPPINGS *table-mode-mappings*
|
|||||||
<Leader>tm Toggle table mode for the current buffer. You can change this
|
<Leader>tm Toggle table mode for the current buffer. You can change this
|
||||||
using the |toggle-mode-options-toggle-map| option.
|
using the |toggle-mode-options-toggle-map| option.
|
||||||
|
|
||||||
NOTE This is applicable only if
|
NOTE This is applicable only if |table-mode-always-active| is
|
||||||
|table-mode-always-active| is not set.
|
not set.
|
||||||
|
|
||||||
*table-mode-mappings-trigger*
|
*table-mode-mappings-trigger*
|
||||||
| Trigger table creation in table mode. You can change this
|
| Trigger table creation in table mode. You can change this
|
||||||
@@ -317,7 +229,10 @@ MAPPINGS *table-mode-mappings*
|
|||||||
formulas.
|
formulas.
|
||||||
|
|
||||||
*table-mode-mappings-motions*
|
*table-mode-mappings-motions*
|
||||||
<Leader>t[hjkl] Move to previous | below | above | right cell in the table.
|
[| Move to previous cell
|
||||||
|
]| Move to next cell
|
||||||
|
{| Move to the cell above
|
||||||
|
}| Move to the cell below
|
||||||
|
|
||||||
*table-mode-mappings-delete-row*
|
*table-mode-mappings-delete-row*
|
||||||
<Leader>tdd Delete the entire table row you are on or multiple rows using
|
<Leader>tdd Delete the entire table row you are on or multiple rows using
|
||||||
@@ -387,6 +302,11 @@ COMMANDS *table-mode-commands*
|
|||||||
NOTE this is optional, by default without the expression it will
|
NOTE this is optional, by default without the expression it will
|
||||||
tableize the content using |table-mode-delimiter| as the delimiter.
|
tableize the content using |table-mode-delimiter| as the delimiter.
|
||||||
|
|
||||||
|
*:TableModeRealign*
|
||||||
|
*table-mode-:TableModeRealign*
|
||||||
|
:TableModeRealign
|
||||||
|
This command triggers |table-mode-mappings-realign|
|
||||||
|
|
||||||
*:TableAddFormula*
|
*:TableAddFormula*
|
||||||
*table-mode-:TableAddFormula*
|
*table-mode-:TableAddFormula*
|
||||||
:TableAddFormula
|
:TableAddFormula
|
||||||
|
|||||||
Reference in New Issue
Block a user