I would try something like the following. In my vimrc (or a
:help load-plugins; I often use
~/.vim/after/plugin/config/<pluginname>.vim), I would define
Then, in an ftplugin (
:help ftplugins, I would use
~/.vim/after/ftplugin/vimwiki.vim), make the change:
This type of thing normally works well for dynamic configuration. If UltiSnips creates a mapping when it loads based on this variable (as I suspect it does), it may not be "dynamic"—that is, changing the variable may have no effect. In that case, you will need to find a way to get UltiSnips to change its mappings and such dynamically. Possibly the right combination of
runtime are enough, but otherwise you might have to add some code to UltiSnips to support a buffer-local trigger and such.