Map: Enable changing insert mode table mappings (#1048)
Mapping `<Tab>` and `<S-Tab>` at insert mode sometimes collide with other plugins which utilize these for completions (e.g. coc example mapping). Since for many users the case for completion is more frequent than table editing, this patch enables changing these mappings using the options `<Plug>VimwikiTableNextCell` and `<Plug>VimwikiTablePrevCell`. This patch makes it easier of those using multiple plugins and have no desire or knowledge in debugging the collision. It complements #1030 by providing a more direct and documented method for setting custom keymappings. Signed-off-by: Amit Beka <---> Co-authored-by: Amit Beka <--->
This commit is contained in:
@@ -595,9 +595,13 @@ function! s:CR(normal, just_mrkr) abort
|
||||
endfunction
|
||||
|
||||
" insert mode table mappings
|
||||
inoremap <silent><buffer><expr> <Plug>VimwikiTableNextCell
|
||||
\ vimwiki#tbl#kbd_tab()
|
||||
inoremap <silent><buffer><expr> <Plug>VimwikiTablePrevCell
|
||||
\ vimwiki#tbl#kbd_shift_tab()
|
||||
if str2nr(vimwiki#vars#get_global('key_mappings').table_mappings)
|
||||
inoremap <expr><buffer> <Tab> vimwiki#tbl#kbd_tab()
|
||||
inoremap <expr><buffer> <S-Tab> vimwiki#tbl#kbd_shift_tab()
|
||||
call vimwiki#u#map_key('i', '<Tab>', '<Plug>VimwikiTableNextCell')
|
||||
call vimwiki#u#map_key('i', '<S-Tab>', '<Plug>VimwikiTablePrevCell')
|
||||
endif
|
||||
|
||||
" <Plug> table formatting definitions
|
||||
|
||||
Reference in New Issue
Block a user