Saturday, November 25, 2023

Re: Rely on ‘runtimeparh’ in import autoload

On 2023-11-24, Matan Nassau <matan.nassau@gmail.com> wrote:
> When is it good practice to use the import autoload form that relies
> on 'runtimepath'?
>
> import autoload 'foo.vim'
>
> I think plugins generally know where their autoload stuff is, and can
> gain a few milliseconds by pointing the import directly at it with
> a relative path.
>
> And, the runtimepath form generally won't work when 'loadplugins'
> isn't set (when starting Vim with --clean for example).

What is the use case for an autoload mechanism when plugins have been
turned off? Are you talking about `import autoload` statements in
a vimrc file?

> So what is the feature for

Vim 9 script inherits the autoload mechanism from Vim legacy script,
where runtimepath is used. I think that is the main reason for that
behaviour.

>, when is it a good time to use it?

It's just a matter of personal preference. In most cases the difference
won't be noticeable. I'd stick with relative paths to avoid potential,
although probably rare, name conflicts.

Life.

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ujssak%24157a%241%40ciao.gmane.io.

No comments: