{"action":"created","issue":{"url":"https://api.github.com/repos/junegunn/vim-plug/issues/544","repository_url":"https://api.github.com/repos/junegunn/vim-plug","labels_url":"https://api.github.com/repos/junegunn/vim-plug/issues/544/labels{/name}","comments_url":"https://api.github.com/repos/junegunn/vim-plug/issues/544/comments","events_url":"https://api.github.com/repos/junegunn/vim-plug/issues/544/events","html_url":"https://github.com/junegunn/vim-plug/issues/544","id":185390090,"number":544,"title":"Proper order for dependencies and conditionals? (Suggestion for FAQ or README)","user":{"login":"leblancfg","id":15659410,"avatar_url":"https://avatars.githubusercontent.com/u/15659410?v=3","gravatar_id":"","url":"https://api.github.com/users/leblancfg","html_url":"https://github.com/leblancfg","followers_url":"https://api.github.com/users/leblancfg/followers","following_url":"https://api.github.com/users/leblancfg/following{/other_user}","gists_url":"https://api.github.com/users/leblancfg/gists{/gist_id}","starred_url":"https://api.github.com/users/leblancfg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leblancfg/subscriptions","organizations_url":"https://api.github.com/users/leblancfg/orgs","repos_url":"https://api.github.com/users/leblancfg/repos","events_url":"https://api.github.com/users/leblancfg/events{/privacy}","received_events_url":"https://api.github.com/users/leblancfg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-26T13:15:48Z","updated_at":"2016-10-26T14:33:11Z","closed_at":"2016-10-26T14:33:11Z","body":"<!--\r\n### Before Submitting\r\n\r\n- You checked the [faq](https://github.com/junegunn/vim-plug/wiki/faq) for common problems.\r\n- Check your [requirements](https://github.com/junegunn/vim-plug/wiki/requirements) are satisfied.\r\n- You are not going to suggest vim-plug manage itself like Vundle, see #240, #364, #367 ...\r\n-->\r\n\r\nWhen using both conditional loads and dependencies on the same line, it is not clear from the readme or wiki whether to use:\r\n\r\n`Plug 'jceb/vim-orgmode', { 'for': 'org' } | Plug 'tpope/vim-speeddating' | Plug 'mattn/calendar-vim'`\r\n\r\nor\r\n\r\n`Plug 'jceb/vim-orgmode' | Plug 'tpope/vim-speeddating' | Plug 'mattn/calendar-vim' , { 'for': 'org' }`\r\n\r\nor\r\n\r\n`Plug 'jceb/vim-orgmode' , { 'for': 'org' } | Plug 'tpope/vim-speeddating' , { 'for': 'org' } | Plug 'mattn/calendar-vim' , { 'for': 'org' }`\r\n\r\nI believe the first one should be used, but it might be valuable to let the users know which.\r\n\r\nThanks again for an amazing piece of work!\r\n\r\n------------------------------\r\n\r\n<!-- Put the contents of `:version` below -->\r\n```\r\nvim-plug v.0.9.1\r\n```\r\n\r\n<!-- Check all that apply. -->\r\n- Type:\r\n    - [ ] Bug\r\n    - [x] Enhancement\r\n    - [ ] Feature Request\r\n    - [ ] Question\r\n- OS:\r\n    - [x] All/Other\r\n    - [ ] Linux\r\n    - [ ] OS X\r\n    - [ ] Windows\r\n- Vim:\r\n    - [x] All/Other\r\n    - [ ] Terminal Vim\r\n    - [ ] GVim\r\n    - [ ] Neovim\r\n"},"comment":{"url":"https://api.github.com/repos/junegunn/vim-plug/issues/comments/256365979","html_url":"https://github.com/junegunn/vim-plug/issues/544#issuecomment-256365979","issue_url":"https://api.github.com/repos/junegunn/vim-plug/issues/544","id":256365979,"user":{"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},"created_at":"2016-10-26T14:33:11Z","updated_at":"2016-10-26T14:33:11Z","body":"Thanks for the suggestion. But actually there is no concept of plugin dependency in vim-plug. The example simply suggests that you can write two (or more) Plug commands in a row using `|` which acts like a semi-colon in other programming languages. It's a standard Vimscript syntax. Maybe I should clarify that in the doc.\r\n\r\nThe order almost always doesn't matter. The only case the order matters is when some plugin overrides the commands or mappings from another plugin and in that case just make sure that the Plug command for the former comes after that for the latter.\r\n\r\n```vim\r\nPlug 'base-plugin'\r\nPlug 'overriding-plugin'\r\n\r\n\" Or equivalently,\r\nPlug 'base-plugin' | Plug 'overriding-plugin'\r\n```\r\n\r\nAs for conditional loading, I always say this: you probably don't need it. A well-written Vim plugin already loads lazily and orgmode is a good example. `vim --startuptime a.log` reveals that orgmode only loads ftdetect file in a very small amount of time, and in that case applying `on` or `for` option gives you zero benefit. It only makes your vimrc more complicated. I guess you probably mentioned orgmode just as an example, but the point remains. Setting the condition before looking at `--startuptime` log is a premature optimization and in most cases you don't need it.\r\n\r\nIf you truly need to set the condition for a set of dependent plugins, you'll have to repeat the same option for each plugin, because vim-plug doesn't know about the dependency.\r\n\r\n```vim\r\nPlug 'a', { 'for': 'foo' } | Plug 'b', { 'for': 'foo' } | Plug 'c', { 'for': 'foo' }\r\n```"}}
{"actor":{"display_login":"junegunn"}}