diff --git a/autoload/tablemode.vim b/autoload/tablemode.vim index daac6fa..cfb931c 100644 --- a/autoload/tablemode.vim +++ b/autoload/tablemode.vim @@ -4,7 +4,7 @@ " Author: Dhruva Sagar " License: MIT (http://www.opensource.org/licenses/MIT) " Website: http://github.com/dhruvasagar/vim-table-mode -" Version: 3.3.0 +" Version: 3.3.2 " Note: This plugin was heavily inspired by the 'CucumberTables.vim' " (https://gist.github.com/tpope/287147) plugin by Tim Pope. " diff --git a/doc/table-mode.txt b/doc/table-mode.txt index 7c385b1..17725c2 100644 --- a/doc/table-mode.txt +++ b/doc/table-mode.txt @@ -1,7 +1,7 @@ -*table-mode.txt* Table Mode for easy table formatting. v3.3 +*table-mode.txt* Table Mode for easy table formatting. v3.3.2 =============================================================================== Table Mode, THE AWESOME AUTOMATIC TABLE CREATOR & FORMATTER - VERSION 3.3 + VERSION 3.3.2 Author: Dhruva Sagar License: MIT @@ -272,6 +272,12 @@ g:table_mode_eval_expr_map *table-mode-eval-expr-map* 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 = '?' +< + =============================================================================== MAPPINGS *table-mode-mappings* @@ -300,6 +306,9 @@ MAPPINGS *table-mode-mappings* *table-mode-mappings-realign* tr Realigns table columns +t? Echo the current table cells representation for defining + formulas. + *table-mode-mappings-motions* t[hjkl] Move to previous | below | above | right cell in the table. diff --git a/plugin/table-mode.vim b/plugin/table-mode.vim index 09c7102..0c41474 100644 --- a/plugin/table-mode.vim +++ b/plugin/table-mode.vim @@ -4,7 +4,7 @@ " Author: Dhruva Sagar " License: MIT (http://www.opensource.org/licenses/MIT) " Website: http://github.com/dhruvasagar/vim-table-mode -" Version: 3.3.1 +" Version: 3.3.2 " Note: This plugin was heavily inspired by the 'CucumberTables.vim' " (https://gist.github.com/tpope/287147) plugin by Tim Pope. " @@ -50,6 +50,7 @@ call s:SetGlobalOptDefault('table_mode_delete_row_map', 'dd') call s:SetGlobalOptDefault('table_mode_delete_column_map', 'dc') call s:SetGlobalOptDefault('table_mode_add_formula_map', 'fa') call s:SetGlobalOptDefault('table_mode_eval_expr_map', 'fe') +call s:SetGlobalOptDefault('table_mode_echo_cell_map', '?') function! s:TableMotion() "{{{1 let direction = nr2char(getchar()) @@ -58,6 +59,12 @@ function! s:TableMotion() "{{{1 endfor endfunction +function! s:TableEchoCell() "{{{1 + if tablemode#IsATableRow('.') + echomsg '$' . tablemode#RowNr('.') . ',' . tablemode#ColumnNr('.') + endif +endfunction + " Define Commands & Mappings {{{1 if !g:table_mode_always_active "{{{2 exec "nnoremap " . g:table_mode_map_prefix . g:table_mode_toggle_map . @@ -101,6 +108,8 @@ execute "nnoremap " . g:table_mode_map_prefix . g:table_mode_add_formul \ " :TableAddFormula" execute "nnoremap " . g:table_mode_map_prefix . g:table_mode_eval_expr_map . \ " :TableEvalFormulaLine" +execute "nnoremap " . g:table_mode_map_prefix . g:table_mode_echo_cell_map . + \ " :call TableEchoCell()" " Avoiding side effects {{{1 let &cpo = s:save_cpo