junegunn / junegunn/vim-plug

Add to wiki/documentation for how multiple options (ex 'for' languages) are parsed

Open
#1,196 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vim Script
Stars
35.8k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

> Anyway, `for` option was designed to take a string of a single file type or a list of multiple file types, and there's no code in vim-plug that processes comma-separated file types. It may not work correctly if you have multiple plugins with overlapping sets of `for` options.
>
> ``` vim
> Plug 'foo', { 'for': 'a,b,c' }
> Plug 'bar', { 'for': 'b,c' }
> ```
>
> When a file of type `a` is open, `foo` is loaded, and vim-plug will try to clear the hook by executing `autocmd! PlugLOD Filetype a,b,c`, which will cause the autocmds for `bar` to be cleared as well, and `bar` will never get loaded.
>
> But if you specify the types as a list, vim-plug will correctly handle such cases.
>
> ``` vim
> Plug 'foo', { 'for': ['a', 'b', 'c'] }
> Plug 'bar', { 'for': ['b', 'c'] }
> ```
>
> _Originally posted by @junegunn in https://github.com/junegunn/vim-plug/issues/259#issuecomment-122892087_

This was the only (non-source code) documentation I could find on this.
It would be helpful to add this to the wiki/documentation.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.