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

Reasoning behind "symlink" and "copy" strategy #316

Open
hupfdule opened this issue Jan 14, 2020 · 1 comment
Open

Reasoning behind "symlink" and "copy" strategy #316

hupfdule opened this issue Jan 14, 2020 · 1 comment

Comments

@hupfdule
Copy link
Contributor

Hi,

this is just a question.

What is the reason for downloading the actual git repository to
$VOLTREPOSPATH and later copying or symlinking them to ~/.vim/pack/volt/opt
instead of storing them in ~/.vim/pack/volt/opt directly?

Since the bundled_plugconf.vim file is generated for the current profile,
the ~/.vim/pack/volt/opt directory could actually contain the repositories
for all profiles, but the bundled_plugconf.vim file would only load those
that are active in the current profile.

This would also allow the user to activate a plugin manually that is not
contained in the current profile.¹

Is there something I a missing? Is there some additional benefit of
separating the $VOLTREPOSPATH and the ~/.vim/pack/volt/opt directory?

I thought about adding an additional build strategy to volt for the purpose
of downloading the git repositories directly to ~/.vim/pack/volt/opt, but
noticed that this would be an intrusive change that needed to be applied to a
bunch of other places, too.

[¹] However, that would leave out the plugconf file for that plugin. To
allow reading the plugconf file in such a case the user would need a
vim-volt plugin that provides a command (e.g. Packadd) to load the package
with packadd and read in the corresponding plugconf file.

@tyru
Copy link
Member

tyru commented Jan 14, 2020

I didn't think about cloning repositories to ~/.vim/pack/volt/opt directly, because I thought pre-processing feature of Vim script files like uglifying the codes to reduce parsing time.
It should be the good option. But there should be more things that we think about.

Vim 9

Vim script code is parsed on every executions, real interpreter language in 2020.
But Bram seems to be working with optimizing Vim script execution time by compiling the code to VM instructions like recent interpreter (yes, not really) languages do.
https://github.com/brammool/vim9

I don't know it really makes uglifying useless, but at least, I am also thinking that all repositories should be in ~/.vim/pack/volt/opt.
But I imagined all symlinks are under ~/.vim/pack/volt/opt.
Because it allows to select a profile or plugins at startup conditionally as you said

This would also allow the user to activate a plugin manually that is not contained in the current profile.¹

and I thought it in the context of #172.

Want to skip volt build as possible

But note that even repositories are placed in ~/.vim/pack/volt/opt, volt build is necessary to generate bundled_plugconf.vim, copying vimrc, and gvimrc.
As one volt user, of course I want to skip volt build as possible, because I sometimes forgot volt build after editing plugconf files, vimrc, or gvimrc.
As a first step, when stategy=symlink, vimrc/gvimrc should also be symlinks. #247

And, currently plugins & plugconf files are loaded by generated bundled_plugconf.vim.
Because it can enable/disable plugins, switch current profile, and so on without editing vimrc unlike other plugin managers.
It is hard to parse vimrc file to do such things.
So I don't want users to write plugin list or profile name in vimrc as possible.
But as #172 (comment) #308 (comment) said, it should be useful if there is an intrusive way to control loading plugins from vimrc.

  • I want to enable/disable plugins, switch current profile, and so on
  • It needs plugconf files (separated files from vimrc)
  • But I want to skip volt build as possible :(
  • I need a way to run volt build automatically at Vim startup?
    • I don't want to slow down Vim startup too :(

I'm wondering plugconf files should be loadable, not just DSL to generate bundled_plugconf.vim.
However, sourcing many plugconf files might slow down Vim startup... Vim9's Module saves us?
I'm also wondering that I should implement plugconf/bundled_plugconf-like features in Vim itself.

I don't know what to do yet clearly to skip volt build.

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

No branches or pull requests

2 participants