Closed lsimmons2 closed 4 years ago
This is by design, since the actions Tableize
is used to convert existing content into a table, these are relevant even when table mode is not enabled. There are configurations provided that allow to change these mappings. I would suggest you read more in the :h table-mode
@dhruvasagar thanks but I tried using let g:table_mode_disable_mappings = 1
and those three mappings were still there. Tried deleting plugin and reinstalling with that variable set with the same result. What's the right way to get rid of those mappings?
@lsimmons2 Like I said, these mappings aren't related to table-mode
mappings and are available globally because they're relevant even when no table exists.
Quoting from help :
g:table_mode_tableize_map *table-mode-tableize-map*
Set this to configure the mapping for converting the visual selection
to a table. >
let g:table_mode_tableize_map = '<Leader>tt'
>
g:table_mode_tableize_d_map *table-mode-tableize-d-map*
Set this to configure the mapping for converting the visual selection
to a table, asking the user for a delimiter. >
let g:table_mode_tableize_d_map = '<Leader>T'
>
@lsimmons2 You should be able to disable these mappings adding the following configuration :
nmap <Plug>(table-mode-tableize) <Nop>
nmap <Plug>(table-mode-tableize-delimiter) <Nop>
If however you wish to change the mappings to something different, you can use the provided configurations
Trying that and those mappings still show up in :map
.
@lsimmons2 Thanks, turns out I misunderstood how <Nop>
is supposed to work. I have pushed a new configuration g:table_mode_disable_tableize_mappings
which you can set to 1
(Default is 0
) to disable these mappings.
@dhruvasagar thanks for your help. I just updated the plugin and when setting let g:table_mode_disable_tableize_mappings=1
those mappings are gone, but a new one shows up now: n <Space>tm * :<C-U>call tablemode#Toggle()<CR>
@lsimmons2 Yes that is used to enable table mode, if you want to disable that too, you might as well uninstall the plugin
@dhruvasagar ok and it couldn't be set up so that the user could choose to disable this mapping or just have it be an unmapped <Plug>
command by default? I'd imagine most users of this plugin are experienced Vim users who would want to set up their own mappings anyway and wouldn't like not being able to remove a default mapping since it feels like it "pollutes" their :map
space.
Personally, I have let mapleader=" "
and nnoremap <leader>t :tabnew<CR>
, so because of n <Space>tm * :<C-U>call tablemode#Toggle()<CR>
I have to wait for the timeout
before a new tab opens. It gets frustrating :)
@lsimmons2 Most mappings are available as plug mappings and the defaults are applied only if the user does not set these themselves. There are also convenience configurations available that can also be used to override these mappings in different ways.
Some configurations that you could leverage would be g:table_mode_map_prefix
, this is used as a prefix for all table wide mappings, if you changed this to something like <Leader>r
the table mode toggle mapping would become <Leader>rm
. You can also change the non-prefix part of that mapping by setting g:table_mode_toggle_map
.
All of this is described in detail in the help documentation.
I set let g:table_mode_map_prefix = "<Leader>xxxxxxxxxxxxxxxxxx"
because I really don't want plugins taking over the mappings that I have composed over the years.
let g:table_mode_disable_mappings = 1
let g:table_mode_disable_tableize_mappings = 1
let g:table_mode_map_prefix = "<Leader>xxxxxxxxxxxxxxxxxx"
Instead, I just set an autocmd
for *.md
for automatically resizing the tables.
Hi, thanks for the great plugin! When I start up vim, before calling
:TableModeToggle
(vim-table-mode not enabled) I have some vim-table-mode mappings already set.:map
shows:Are these mappings supposed to be here even when vim-table-mode is not enabled? Can I disable these by default?
This is with Vim version 8.0.1453, installed with Vim-Plug.