The plugin manager dein
organizes all plugins in a single runtime path:
Merge the plugins directories automatically to avoid long 'runtimepath'
In my case, this is located here:
~/.cache/vim/dein/.cache/vimrc/.dein
❯ tree -d -L 1
.
├── UltiSnips
├── after
├── autoload
├── bin
├── colors
├── common
├── compiler
├── contrib
├── ctags
├── data
├── doc
├── docs
├── examples
├── ftdetect
├── ftplugin
...
However, since vimtex and matchup provide the same file
after/ftplugin/tex.vim
only one will be installed by default.
dein
already provides a solution for this: add the flag merged=0
:
call dein#add('andymass/vim-matchup', { 'merged': 0 })
However, for beginner this is not obvious and vim also provides a simple solution which makes this more fool proof and the runtime path can be kept as short as possible as intended: add _matchup
to the filename`
after/ftplugin/tex_matchup.vim
(and similar for the additions to other filetypes.)
What do you think?
One minor thing is: I am used to open files related to tex settings via :Ve */ftplugin/tex.vim
(:Ve
from vim-scriptease
). However, I should use :Ve */ftplugin/tex*.vim
.
For reference :h ftplugin-name
:
USING A FILETYPE PLUGIN *ftplugin-name*
You can add a filetype plugin by dropping it in the right directory. The
name of this directory is in the same directory mentioned above for global
plugins, but the last part is "ftplugin". Suppose you have found a plugin for
the "stuff" filetype, and you are on Unix. Then you can move this file to the
ftplugin directory: >
mv thefile ~/.vim/ftplugin/stuff.vim
If that file already exists you already have a plugin for "stuff". You might
want to check if the existing plugin doesn't conflict with the one you are
adding. If it's OK, you can give the new one another name: >
mv thefile ~/.vim/ftplugin/stuff_too.vim
The underscore is used to separate the name of the filetype from the rest,
which can be anything. If you use "otherstuff.vim" it wouldn't work, it would
be loaded for the "otherstuff" filetype.