Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide config to bypass vim autoload #2260

Closed
wants to merge 1 commit into from

Conversation

JackDanger
Copy link

@JackDanger JackDanger commented Jul 27, 2016

This PR addresses some of the user frustration in #2085 and #2071 and is something I've really enjoyed having.

  • I have read and understood YCM's [CONTRIBUTING][cont] document.
  • I have read and understood YCM's [CODE_OF_CONDUCT][code] document.
  • I have included tests for the changes in my PR. If not, I have included a
    rationale for why I haven't.
  • I understand my PR may be closed if it becomes obvious I didn't
    actually perform all of these steps.

Why this change is necessary and useful

The current plugin/youcompleteme.vim registers the autoload to execute during the VimEnter stage. But even VimEnter must complete before the user can begin editing a buffer. Because of this the YCM vim setup dominates the boot time of even vim configs that leverage dozens of plugins. Executing youcompleteme#Enable() can take hundreds of milliseconds even on a modern piece of hardware.

This change allows users to disable the default autoloading if they wish so that they can execute youcompleteme#Enable() at a more appropriate time and get to an editable buffer faster. It's an advanced user feature, for sure, but I can't think of a better way to allow extremely fast startup time while also using YCM, can you?

No automated tests added because the viml doesn't appear to be tested. The change seems to work well, however.


This change is Reviewable

Even deferring the autoload to the `VimEnter` stage isn't enough to prevent noticeable slowdown in booting vim. Executing `youcompleteme#Enable()` can still take hundreds of milliseconds even on a modern piece of hardware.

This allows users to disable the default autoloading if they wish so that they can execute `youcompleteme#Enable()` at a more appropriate time and get to an editable buffer faster.
@puremourning
Copy link
Member

Thanks for sending a PR!

Could you not just install it in the packages and use :packadd ? We already have support for that. This is implementing another way to achieve the same thing, which I'm not keen on, in particular as the existing mechanism is a vim-provided one that doesn't require (particularly) 'advanced' knowledge.

In any case this is a new user option, so needs docs in README.md.


Review status: 0 of 1 files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@vheon
Copy link
Contributor

vheon commented Jul 27, 2016

I think that this is a fix for a specific way of using plugins in vim which is not the common one. What I see users doing is that users which require lazy-loading plugins generally use either vim-plug or the latest vim feature like :packadd and we already cover that usage the way it is. So instead of adding yet another option that really few users will take advantage of why don't you add YouCompleteMe to the runtimepath only when you want to load it and then call youcompleteme#Enable()?


Review status: 0 of 1 files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

@Valloric
Copy link
Member

Thanks for the PR!

If the :packadd feature supports this use-case, then I don't think we need another way.


Review status: 0 of 1 files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

@vheon
Copy link
Contributor

vheon commented Jul 27, 2016

If the :packadd feature supports this use-case, then I don't think we need another way.

We already support the :packadd feature


Review status: 0 of 1 files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

@JackDanger
Copy link
Author

Closing this and going with :packadd. Thanks, all!

@JackDanger JackDanger closed this Jul 29, 2016
@Grueslayer
Copy link

Grueslayer commented Nov 6, 2016

I like vim-plug for it's easy upgrade of available packages (and lazy loading). Using the 8.0 :packadd feature gives me only the pathogen-features. So I have to take care of newer versions by hand.
Using YCM on Windows is a pain (loading time is several seconds) by "normal" loading (pathogen / vim-plug / vundle / direct copy to the .vim folder)

@vheon
Copy link
Contributor

vheon commented Nov 6, 2016

@Grueslayer You can use vim-plug with YCM without problem, even lazy-loading it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants