{"action":"created","issue":{"url":"https://api.github.com/repos/junegunn/vim-plug/issues/149","labels_url":"https://api.github.com/repos/junegunn/vim-plug/issues/149/labels{/name}","comments_url":"https://api.github.com/repos/junegunn/vim-plug/issues/149/comments","events_url":"https://api.github.com/repos/junegunn/vim-plug/issues/149/events","html_url":"https://github.com/junegunn/vim-plug/issues/149","id":54728973,"number":149,"title":"On demand loading doesn't work with YouCompleteMe","user":{"login":"vicaya","id":11239,"avatar_url":"https://avatars.githubusercontent.com/u/11239?v=3","gravatar_id":"","url":"https://api.github.com/users/vicaya","html_url":"https://github.com/vicaya","followers_url":"https://api.github.com/users/vicaya/followers","following_url":"https://api.github.com/users/vicaya/following{/other_user}","gists_url":"https://api.github.com/users/vicaya/gists{/gist_id}","starred_url":"https://api.github.com/users/vicaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vicaya/subscriptions","organizations_url":"https://api.github.com/users/vicaya/orgs","repos_url":"https://api.github.com/users/vicaya/repos","events_url":"https://api.github.com/users/vicaya/events{/privacy}","received_events_url":"https://api.github.com/users/vicaya/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/junegunn/vim-plug/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-01-19T05:59:47Z","updated_at":"2015-01-20T23:59:52Z","closed_at":"2015-01-19T10:12:55Z","body":"YouCompleteMe is quite heavy (causes an extra 180ms in loading time on a fast i7 machine; much slower on older machines). I'd like to have it load on demand. Here is what I found:\r\n\r\nIf I use 'on' command, I get something like the following, no matter which ycm command I try:\r\n```\r\nError detected while processing function <SNR>2_lod_cmd:\r\nline    2:\r\nE492: Not an editor command: YcmCompleter\r\n```\r\nIf I use 'L' to load YouCompleteMe in the PlugStatus page, it'll show the plugin as OK but the YCM commands will not be available with error messages like this:\r\n```\r\nE492: Not an editor command: YcmCompleter\r\n```\r\nIt seems to work with 'for' filetype triggers on startup (e.g. vim whatever.ch if I have 'on': 'chill') only. It doesn't work with ':e whatever.ch' though, so I can't load the plugin during a session."},"comment":{"url":"https://api.github.com/repos/junegunn/vim-plug/issues/comments/70759881","html_url":"https://github.com/junegunn/vim-plug/issues/149#issuecomment-70759881","issue_url":"https://api.github.com/repos/junegunn/vim-plug/issues/149","id":70759881,"user":{"login":"vheon","id":90633,"avatar_url":"https://avatars.githubusercontent.com/u/90633?v=3","gravatar_id":"","url":"https://api.github.com/users/vheon","html_url":"https://github.com/vheon","followers_url":"https://api.github.com/users/vheon/followers","following_url":"https://api.github.com/users/vheon/following{/other_user}","gists_url":"https://api.github.com/users/vheon/gists{/gist_id}","starred_url":"https://api.github.com/users/vheon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vheon/subscriptions","organizations_url":"https://api.github.com/users/vheon/orgs","repos_url":"https://api.github.com/users/vheon/repos","events_url":"https://api.github.com/users/vheon/events{/privacy}","received_events_url":"https://api.github.com/users/vheon/received_events","type":"User","site_admin":false},"created_at":"2015-01-20T23:59:52Z","updated_at":"2015-01-20T23:59:52Z","body":"> I have 28 at the moment\r\n\r\nAnd you would not care to update them faster?\r\nI'm actually against this `before`/`after` thing because it seems to bring almost zero value to vim-plug. \r\n\r\n> With this option, we can make the 'on', 'for' and 'L' all work properly for such plugins.\r\n\r\nI'm really curious to know which are this plugins except YCM (which I'm currently testing for removing the VimEnter autocmd)\r\n\r\n> Well, most people think that pathogen is a minimalist plugin manager, which doesn't do install and update.\r\n\r\nWell apparently most people can't read: directly from the vim-pathogen repo\r\n```\r\npathogen.vim: manage your runtimepath\r\n```\r\n\r\nwhich means that is no plugin manager, a great tool (I used it myself before switching) but not a plugin manager.\r\n\r\n> log/notify the plugin loading events for 3rd-party plugin/tool/service integration etc.\r\n\r\nTo me this sounds like the `Plugfile` all over again, namely a cool idea that no one used.\r\n\r\n> Although I added on-demand loading feature to vim-plug, fundamentally, it's just a stopgap solution to the problem. A plugin properly using autoload and ftplugin should load instantly and the right approach I believe is to fix plugins that take too long to load, not to find workarounds.\r\n\r\nThat is the key point that most people do not understand. Vim already has the right functionality for doing the base minimum during the startup, see `ftplugin`, `autoload` etc etc, but most people think that using the lazy loading is the only thing to do for speed up vim startup. For example the worst thing one can do with the lazy loading is lazy loading syntax plugin for \"rarely used\" filetype. That is because usually a syntax file for a filetype also has a `ftdetect` file, and if you lazy load the plugin, vim will not be able to read such `ftdetect` file, so the plugin manager has to force sourcing that file and load the rest later. Well vim would be able to do all of that for free, so one think that [s]he's been speeding vim up when instead [s]he's been slowing it down."}}