{"action":"created","issue":{"url":"https://api.github.com/repos/junegunn/vim-plug/issues/410","repository_url":"https://api.github.com/repos/junegunn/vim-plug","labels_url":"https://api.github.com/repos/junegunn/vim-plug/issues/410/labels{/name}","comments_url":"https://api.github.com/repos/junegunn/vim-plug/issues/410/comments","events_url":"https://api.github.com/repos/junegunn/vim-plug/issues/410/events","html_url":"https://github.com/junegunn/vim-plug/issues/410","id":134147599,"number":410,"title":"Lazy loading after/syntax/*.vim in plugins ","user":{"login":"davidjb","id":1002811,"avatar_url":"https://avatars.githubusercontent.com/u/1002811?v=3","gravatar_id":"","url":"https://api.github.com/users/davidjb","html_url":"https://github.com/davidjb","followers_url":"https://api.github.com/users/davidjb/followers","following_url":"https://api.github.com/users/davidjb/following{/other_user}","gists_url":"https://api.github.com/users/davidjb/gists{/gist_id}","starred_url":"https://api.github.com/users/davidjb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidjb/subscriptions","organizations_url":"https://api.github.com/users/davidjb/orgs","repos_url":"https://api.github.com/users/davidjb/repos","events_url":"https://api.github.com/users/davidjb/events{/privacy}","received_events_url":"https://api.github.com/users/davidjb/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/junegunn/vim-plug/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"junegunn","id":700826,"avatar_url":"https://avatars.githubusercontent.com/u/700826?v=3","gravatar_id":"","url":"https://api.github.com/users/junegunn","html_url":"https://github.com/junegunn","followers_url":"https://api.github.com/users/junegunn/followers","following_url":"https://api.github.com/users/junegunn/following{/other_user}","gists_url":"https://api.github.com/users/junegunn/gists{/gist_id}","starred_url":"https://api.github.com/users/junegunn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junegunn/subscriptions","organizations_url":"https://api.github.com/users/junegunn/orgs","repos_url":"https://api.github.com/users/junegunn/repos","events_url":"https://api.github.com/users/junegunn/events{/privacy}","received_events_url":"https://api.github.com/users/junegunn/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2016-02-17T01:19:05Z","updated_at":"2016-02-17T22:44:17Z","closed_at":"2016-02-17T16:34:59Z","body":"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:\r\n``` \r\nPlug 'Rykka/riv.vim', { 'for': 'rst' }\r\nlet g:riv_python_rst_hl = 1\r\n```\r\nThis causes all the `after/syntax/*.vim` (eg both `python.vim` and `rst.vim` files in its [after/syntax](https://github.com/Rykka/riv.vim/tree/master/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](https://github.com/Rykka/riv.vim/issues/64) down the line).\r\n\r\nIf 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.\r\n\r\nSo, should vim-plug only source the `after/syntax/<filetype>.vim` when lazy-loading, or is this something `riv.vim` should be guarding against?\r\n\r\nI'm using the latest version of vim-plug with VIM - Vi IMproved 7.4 patches: 1-712 on Ubuntu 15.10.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/junegunn/vim-plug/issues/comments/185443051","html_url":"https://github.com/junegunn/vim-plug/issues/410#issuecomment-185443051","issue_url":"https://api.github.com/repos/junegunn/vim-plug/issues/410","id":185443051,"user":{"login":"davidjb","id":1002811,"avatar_url":"https://avatars.githubusercontent.com/u/1002811?v=3","gravatar_id":"","url":"https://api.github.com/users/davidjb","html_url":"https://github.com/davidjb","followers_url":"https://api.github.com/users/davidjb/followers","following_url":"https://api.github.com/users/davidjb/following{/other_user}","gists_url":"https://api.github.com/users/davidjb/gists{/gist_id}","starred_url":"https://api.github.com/users/davidjb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidjb/subscriptions","organizations_url":"https://api.github.com/users/davidjb/orgs","repos_url":"https://api.github.com/users/davidjb/repos","events_url":"https://api.github.com/users/davidjb/events{/privacy}","received_events_url":"https://api.github.com/users/davidjb/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T22:44:17Z","updated_at":"2016-02-17T22:44:17Z","body":"Thanks @junegunn, works perfectly."}}