Do I need to add other language files for syntax etc.. if I already have vim-polyglot which have pretty much every language.

If I install another language package will they conflict with each other?


Vim's ftplugin (also syntax etc.) uses :runtime! to load 2nd level plugins which means all found files will be sourced. Also normally ftplugin plugins include the standard guard at the top of file

" Only do this when not done yet for this buffer
if (exists("b:did_ftplugin"))
let b:did_ftplugin = 1

For this reason, there should not be any kind of "simple conflict", but you'll be dependent on the load-order instead. As the load-order itself depends on (reverse) lexicographical order, it doesn't seem any practical.

So you probably have to deal with package own setup, such as let g:polyglot_disabled = ['foobar'], as suggested in polyglot's README.

| improve this answer | |
  • Not all ftplugins do this; when you want to extend an ftplugin, you omit the guard (eg, none of my .vim/after/ftplugin files have it). – D. Ben Knoble May 14 at 13:24
  • @D.BenKnoble Well, I write "normally", not "always". Of course, "after"-plugins, or ".foo.bar.baz"-plugins are supposed to extend existing functionality, and so they are exceptions under this topic. – Matt May 14 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.