Skip to content

Lazy loading after/syntax/*.vim in plugins  #410

Description

@davidjb

A plugin I'm using riv.vim is having all after/sytax/*.vim files included by vim-plug when I'm using lazy loading by filetype. My particular issue comes up with:

Plug 'Rykka/riv.vim', { 'for': 'rst' }
let g:riv_python_rst_hl = 1

This causes all the after/syntax/*.vim (eg both python.vim and rst.vim files in its after/syntax folder) to be sourced by vim-plug when opening an .rst file. The second line is needed to enable rst syntax in Python files (and pass a check in its after/syntax/python.vim). The result of sourcing both files is that python.vim also sources rst.vim; resulting in a double-inclusion of rst.vim (which raises an error down the line).

If not using lazy loading, there's no issue as only the after/syntax/rst.vim gets sourced on file open. The globbing at https://github.com/junegunn/vim-plug/blob/master/plug.vim#L424, which is called by line 433, is sourcing all files in a plugin's after/syntax directory.

So, should vim-plug only source the after/syntax/<filetype>.vim when lazy-loading, or is this something riv.vim should be guarding against?

I'm using the latest version of vim-plug with VIM - Vi IMproved 7.4 patches: 1-712 on Ubuntu 15.10.

Thanks!

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions