mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-08 11:03:47 -05:00
Version 4.4.2
* Updated mappings to be buffer local * Updated mappings to toggle with Table Mode
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## Version 4.4.2
|
||||||
|
* Updated mappings to be buffer local.
|
||||||
|
* Updated mappings to toggle and function only when table mode is active.
|
||||||
|
|
||||||
## Version 4.4.1
|
## Version 4.4.1
|
||||||
* Added syntax for matching tables
|
* Added syntax for matching tables
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# VIM Table Mode v4.4.1 [](https://travis-ci.org/dhruvasagar/vim-table-mode)
|
# VIM Table Mode v4.4.2 [](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.
|
||||||
|
|||||||
@@ -33,15 +33,87 @@ function! s:SetBufferOptDefault(opt, val) "{{{2
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:ToggleMapping() "{{{2
|
function! s:ToggleMapping() "{{{2
|
||||||
if exists('b:table_mode_active') && b:table_mode_active
|
let separator_map = g:table_mode_separator
|
||||||
call s:SetBufferOptDefault('table_mode_separator_map', g:table_mode_separator)
|
|
||||||
" '|' is a special character, we need to map <Bar> instead
|
" '|' is a special character, we need to map <Bar> instead
|
||||||
if g:table_mode_separator ==# '|' | let b:table_mode_separator_map = '<Bar>' | endif
|
if g:table_mode_separator ==# '|' | let separator_map = '<Bar>' | endif
|
||||||
|
|
||||||
execute "inoremap <silent> <buffer> " . b:table_mode_separator_map . ' ' .
|
if tablemode#IsActive()
|
||||||
\ b:table_mode_separator_map . "<Esc>:call tablemode#TableizeInsertMode()<CR>a"
|
execute 'inoremap <silent> <buffer>' separator_map
|
||||||
|
\ separator_map . '<Esc>:call tablemode#TableizeInsertMode()<CR>a'
|
||||||
|
|
||||||
|
if !hasmapto('<Plug>(table-mode-motion-up)', 'n')
|
||||||
|
nmap <buffer> {<Bar> <Plug>(table-mode-motion-up)
|
||||||
|
endif
|
||||||
|
if !hasmapto('<Plug>(table-mode-motion-down)', 'n')
|
||||||
|
nmap <buffer> }<Bar> <Plug>(table-mode-motion-down)
|
||||||
|
endif
|
||||||
|
if !hasmapto('<Plug>(table-mode-motion-left)', 'n')
|
||||||
|
nmap <buffer> [<Bar> <Plug>(table-mode-motion-left)
|
||||||
|
endif
|
||||||
|
if !hasmapto('<Plug>(table-mode-motion-right)', 'n')
|
||||||
|
nmap <buffer> ]<Bar> <Plug>(table-mode-motion-right)
|
||||||
|
endif
|
||||||
|
if !hasmapto('<Plug>(table-mode-cell-text-object-a)', 'o')
|
||||||
|
omap <buffer> a<Bar> <Plug>(table-mode-cell-text-object-a)
|
||||||
|
endif
|
||||||
|
if !hasmapto('<Plug>(table-mode-cell-text-object-i)', 'o')
|
||||||
|
omap <buffer> i<Bar> <Plug>(table-mode-cell-text-object-i)
|
||||||
|
endif
|
||||||
|
if !hasmapto('<Plug>(table-mode-realign)', 'n')
|
||||||
|
nmap <buffer> <Leader>tr <Plug>(table-mode-realign)
|
||||||
|
endif
|
||||||
|
if !hasmapto('<Plug>(table-mode-delete-row)', 'n')
|
||||||
|
nmap <buffer> <Leader>tdd <Plug>(table-mode-delete-row)
|
||||||
|
endif
|
||||||
|
if !hasmapto('<Plug>(table-mode-delete-column)', 'n')
|
||||||
|
nmap <buffer> <Leader>tdc <Plug>(table-mode-delete-column)
|
||||||
|
endif
|
||||||
|
if !hasmapto('<Plug>(table-mode-add-formula)', 'n')
|
||||||
|
nmap <buffer> <Leader>tfa <Plug>(table-mode-add-formula)
|
||||||
|
endif
|
||||||
|
if !hasmapto('<Plug>(table-mode-eval-formula)', 'n')
|
||||||
|
nmap <buffer> <Leader>tfe <Plug>(table-mode-eval-formula)
|
||||||
|
endif
|
||||||
|
if !hasmapto('<Plug>(table-mode-echo-cell)', 'n')
|
||||||
|
nmap <buffer> <Leader>t? <Plug>(table-mode-echo-cell)
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
silent! execute "iunmap <silent> <buffer> " . b:table_mode_separator_map
|
if !empty(maparg(separator_map, 'i'))
|
||||||
|
execute "iunmap <silent> <buffer> " . separator_map
|
||||||
|
endif
|
||||||
|
if !empty(maparg('{<Bar>', 'n'))
|
||||||
|
nunmap <buffer> {<Bar>
|
||||||
|
endif
|
||||||
|
if !empty(maparg('}<Bar>', 'n'))
|
||||||
|
nunmap <buffer> }<Bar>
|
||||||
|
endif
|
||||||
|
if !empty(maparg('[<Bar>', 'n'))
|
||||||
|
nunmap <buffer> [<Bar>
|
||||||
|
endif
|
||||||
|
if !empty(maparg(']<Bar>', 'n'))
|
||||||
|
nunmap <buffer> ]<Bar>
|
||||||
|
endif
|
||||||
|
if !empty(maparg('a<Bar>', 'o'))
|
||||||
|
ounmap <buffer> a<Bar>
|
||||||
|
endif
|
||||||
|
if !empty(maparg('i<Bar>', 'o'))
|
||||||
|
ounmap <buffer> i<Bar>
|
||||||
|
endif
|
||||||
|
if !empty(maparg('<Leader>tdd', 'n'))
|
||||||
|
nunmap <buffer> <Leader>tdd
|
||||||
|
endif
|
||||||
|
if !empty(maparg('<Leader>tdc', 'n'))
|
||||||
|
nunmap <buffer> <Leader>tdc
|
||||||
|
endif
|
||||||
|
if !empty(maparg('<Leader>tfa', 'n'))
|
||||||
|
nunmap <buffer> <Leader>tfa
|
||||||
|
endif
|
||||||
|
if !empty(maparg('<Leader>tfe', 'n'))
|
||||||
|
nunmap <buffer> <Leader>tfe
|
||||||
|
endif
|
||||||
|
if !empty(maparg('<Leader>t?', 'n'))
|
||||||
|
nunmap <buffer> <Leader>t?
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
*table-mode.txt* Table Mode for easy table formatting. v4.4.1
|
*table-mode.txt* Table Mode for easy table formatting. v4.4.2
|
||||||
===============================================================================
|
===============================================================================
|
||||||
Table Mode, THE AWESOME AUTOMATIC TABLE CREATOR & FORMATTER
|
Table Mode, THE AWESOME AUTOMATIC TABLE CREATOR & FORMATTER
|
||||||
VERSION 4.4.1
|
VERSION 4.4.2
|
||||||
|
|
||||||
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/>
|
||||||
|
|||||||
@@ -123,48 +123,6 @@ if !hasmapto('<Plug>(table-mode-tableize-delimiter)')
|
|||||||
xmap <Leader>T <Plug>(table-mode-tableize-delimiter)
|
xmap <Leader>T <Plug>(table-mode-tableize-delimiter)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto('<Plug>(table-mode-realign)')
|
|
||||||
nmap <Leader>tr <Plug>(table-mode-realign)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !hasmapto('<Plug>(table-mode-motion-up)')
|
|
||||||
nmap {<Bar> <Plug>(table-mode-motion-up)
|
|
||||||
endif
|
|
||||||
if !hasmapto('<Plug>(table-mode-motion-down)')
|
|
||||||
nmap }<Bar> <Plug>(table-mode-motion-down)
|
|
||||||
endif
|
|
||||||
if !hasmapto('<Plug>(table-mode-motion-left)')
|
|
||||||
nmap [<Bar> <Plug>(table-mode-motion-left)
|
|
||||||
endif
|
|
||||||
if !hasmapto('<Plug>(table-mode-motion-right)')
|
|
||||||
nmap ]<Bar> <Plug>(table-mode-motion-right)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !hasmapto('<Plug>(table-mode-cell-text-object-a)')
|
|
||||||
omap a<Bar> <Plug>(table-mode-cell-text-object-a)
|
|
||||||
endif
|
|
||||||
if !hasmapto('<Plug>(table-mode-cell-text-object-i)')
|
|
||||||
omap i<Bar> <Plug>(table-mode-cell-text-object-i)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !hasmapto('<Plug>(table-mode-delete-row)')
|
|
||||||
nmap <Leader>tdd <Plug>(table-mode-delete-row)
|
|
||||||
endif
|
|
||||||
if !hasmapto('<Plug>(table-mode-delete-column)')
|
|
||||||
nmap <Leader>tdc <Plug>(table-mode-delete-column)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !hasmapto('<Plug>(table-mode-add-formula)')
|
|
||||||
nmap <Leader>tfa <Plug>(table-mode-add-formula)
|
|
||||||
endif
|
|
||||||
if !hasmapto('<Plug>(table-mode-eval-formula)')
|
|
||||||
nmap <Leader>tfe <Plug>(table-mode-eval-formula)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !hasmapto('<Plug>(table-mode-echo-cell)')
|
|
||||||
nmap <Leader>t? <Plug>(table-mode-echo-cell)
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Avoiding side effects {{{1
|
" Avoiding side effects {{{1
|
||||||
let &cpo = s:save_cpo
|
let &cpo = s:save_cpo
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user