Thursday, April 14, 2016

Re: How to load the vim plugin manually?

On Thursday, April 14, 2016 at 3:45:06 AM UTC-5, 李哲 wrote:
> Raise my question first: how to load a vim script manually? for example I can run a vim script by command line.
>
> I use the vim plugin named AutoComplPop(which vim file named acp.vim). It load automatic at the start of the vim.
>
> I found a acp.vim in the autoload folder, and I delete it. But a error popup `Unknown function: acp#enable`. So I could not delete it.
>
> I search for the topic `vim autoload management` and `vim prevent autoload script`
> but I can't get the answer I want.
>
> So I come here for help.

Autoload may be a bit confusing. It means, "don't source this file right away, only load it when you try to use it."

There is probably a file in a "plugin" or "ftplugin" or both which use functions from the autoload file you were trying to remove.

One way to do this (in older Vims) would be to put the plugin file somewhere else. Leave the autoload file where it is. Then to load the plugin you would ":source path/to/the/file.vim".

Another way is to use a package manager supporting a "load plugins on demand" feature.

In the latest Vim and the upcoming 8.0 release, it gets easier. Your entire plugin can go into ~/.vim/pack/whatever/opt/plugin_name and related folders (autoload, plugin, etc.)

Then to load your plugin you just do :packadd plugin_name.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment