vimtex includes PR #1711 which allows you to configure vimtex to override existing mappings by setting this global variable from your vimrc:
let g:vimtex_mappings_override_existing = 1
So the recommended solution for this problem is update your
vimtex to latest and include this variable setting in your vimrc.
OLDER UPDATE: It turns out
vimtex checks for previously existing mappings, so it will not install one of it mappings if it finds one already exists for that key sequence.
The best workaround I can come up with is that you install these local mappings yourself, for filetype
vim-textobj-entire selectively for
tex filetype only isn't really possible.
You can add your own mappings by creating a file
~/.vim/after/ftplugin/tex.vim with the following contents:
xmap <silent><nowait><buffer> ie <plug>(vimtex-ie)
xmap <silent><nowait><buffer> ae <plug>(vimtex-ae)
omap <silent><nowait><buffer> ie <plug>(vimtex-ie)
omap <silent><nowait><buffer> ae <plug>(vimtex-ae)
That would ensure these mappings will get loaded for filetype
tex, even if
vimtex decides to skip them due to the presence of the global mappings for the same key sequences.
ORIGINAL ANSWER (inaccurate): This should not be necessary at all, since the mappings created by
vim-textobj-entire are global mappings, while the mappings created by
vimtex are local mappings, created for each buffer that triggers the
plaintex etc.) filetype.
Local mappings (created with the
<buffer> modifier to
:map and related commands) override global ones, so the expected behavior is that the
vimtex mappings should already supercede the key-bindings from
Regarding the part about disabling the plug-in by setting global variables, that only really work in the context of your vimrc, before the plug-in is loaded first.
If you look inside
plugin/textobj/entire.vim from that plug-in, you'll see the first few lines are:
So it's only checking at that point, when the plug-in is first loaded, right after the vimrc is processed. Overriding that variable later won't really have any effect, since by then this plug-in will already have been loaded and will have configured its mappings.