Merge pull request #71 from arecarn/fix-sort

Fix sort command, and add documentation for the command and mapping.
This commit is contained in:
Dhruva Sagar
2015-11-17 06:43:19 +01:00
2 changed files with 13 additions and 1 deletions

View File

@@ -349,6 +349,10 @@ MAPPINGS *table-mode-mappings*
would evaluate the formula line and update the table would evaluate the formula line and update the table
accordingly. This invokes the |TableEvalFormulaLine| command. accordingly. This invokes the |TableEvalFormulaLine| command.
*table-mode-mappings-sort-column*
<Leader>ts Sort a column under the cursor. This invokes *TableSort*
|| Expands to a header border. You can change this by changing || Expands to a header border. You can change this by changing
|table-mode-separator| option. You can change the character to |table-mode-separator| option. You can change the character to
be used for te extreme corners of the border by changing be used for te extreme corners of the border by changing
@@ -416,6 +420,14 @@ COMMANDS *table-mode-commands*
This command when invoked from anywhere within the table or directly This command when invoked from anywhere within the table or directly
on the formula line evaluates it and updates the table accordingly. on the formula line evaluates it and updates the table accordingly.
*:TableSort*
*table-mode-:TableSort*
:TableSort[!] [i][u][r][n][x][o]
This command sorts column under the cursor and inherits the same flags
as the *:sort* command.
With [!] the order is reversed.
=============================================================================== ===============================================================================
CONTRIBUTING *table-mode-contributing* CONTRIBUTING *table-mode-contributing*

View File

@@ -108,7 +108,7 @@ nnoremap <silent> <Plug>(table-mode-eval-formula) :call tablemode#spreadsheet#fo
nnoremap <silent> <Plug>(table-mode-echo-cell) :call <SID>TableEchoCell()<CR> nnoremap <silent> <Plug>(table-mode-echo-cell) :call <SID>TableEchoCell()<CR>
nnoremap <silent> <Plug>(table-mode-sort) :call tablemode#spreadsheet#Sort()<CR> nnoremap <silent> <Plug>(table-mode-sort) :call tablemode#spreadsheet#Sort('')<CR>
if !hasmapto('<Plug>(table-mode-tableize)') if !hasmapto('<Plug>(table-mode-tableize)')
exec "nmap " . g:table_mode_map_prefix . "t <Plug>(table-mode-tableize)" exec "nmap " . g:table_mode_map_prefix . "t <Plug>(table-mode-tableize)"