Skip to content

Feature request: shared (essential) plugins #208

Open

Description

@AvianY

I am interested what do you think of the idea of volt defining a special set of plugins which are loaded regardless of which profile you are in.
I noticed that there are many so essential plugins that I use, whom I need always to be active. Such plugins could simply be put in the ../pack/*/start/ directory. Volt could also update them when requested. In the end, only the plugins which are different would be loaded into vim.
Maybe an even better idea would be for volt to define "plugin sets", where for each profile you would choose 2 or more sets which are then loaded. One of these sets could be the "default" set, if the user adds it to this list of sets... just an idea.
as it is right now, I would have to know the subset of my plugins which are essential if I wanted to always copy them to the new profile I create. Also if I decide to add/remove an essential plugin, I have to do the same across all of the profiles.
Could something like this be possible to implement? I think it would greatly improve on the idea of profiles in volt.

Activity

  1. tyru commented on Mar 23, 2018

    @tyru
    Member

    Interesting.
    I think a profile should be able to include another profiles.
    volt get can take URI, so the format should be profile://{profile name}.

    $ volt profile new basic
    $ volt profile add basic tpope/vim-sensible kana/vim-textobj-user kana/vim-textobj-indent
    $ volt profile get profile://basic  # include above 3 plugins to current profile via profile
    
  2. AvianY commented on Mar 23, 2018

    @AvianY
    ContributorAuthor

    Are you saying that this already works, or that this will be implemented?
    I can't get the last command to work...

  3. tyru commented on Mar 23, 2018

    @tyru
    Member

    Currently volt saves repository's paths as {domain}/{user}/{plugin} format in lock.json .
    But that should be saved as URIs, maybe.
    Supported protocols are only https, http, git, ssh, profile.
    (btw, ssh may not work now, I don't test it yet though)

  4. tyru commented on Mar 23, 2018

    @tyru
    Member

    Are you saying that this already works, or that this will be implemented?

    Ah sorry, it is just an idea.
    Not implemented yet.

  5. AvianY commented on Mar 23, 2018

    @AvianY
    ContributorAuthor

    Yes, I think this idea works great for sharing common packages in case you are adding them.
    But let's say that I am removing a package from the 'basic' profile.... How could I apply the same change across all other profiles, for which the 'basic' profile is a subset of them?

  6. tyru commented on Mar 23, 2018

    @tyru
    Member

    I'm thinking data model like this in lock.json:

      "profiles": [
        {
          "name": "default",
          "repos_path": [
            "profile://basic",
            "https://github.com/tyru/caw.vim"
          ]
        },
        {
          "name": "basic",
          "repos_path": [
            "https://github.com/tpope/vim-sensible",
            "https://github.com/kana/vim-textobj-user",
            "https://github.com/kana/vim-textobj-indent"
          ]
        }
      ]

    default profile can use "basic profile + tyru/caw.vim".
    and removing tpope/vim-sensible by volt profile rm basic tpope/vim-sensible (or volt rm tpope/vim-sensible if current profile is basic) makes tpope/vim-sensible unavailable in default profile too.
    And also other profiles which reference basic profile.

  7. AvianY commented on Mar 23, 2018

    @AvianY
    ContributorAuthor

    Yes, great idea! so basically, a profile can equally contain plugins and other profiles, so you can nest them. This is neat! 👍

  8. tyru commented on Apr 7, 2018

    @tyru
    Member

    As I said in #230 (comment) , the syntax of internal string in lock.json should be URN, not URL.

  9. tyru commented on Apr 7, 2018

    @tyru
    Member

    Volt must disallow recursive reference (below is directed graphs).

    • A <---> A
    • A <---> B
    • A ---> B, B ---> C, C ---> A
  10. tyru commented on Apr 8, 2018

    @tyru
    Member

    Volt must disallow recursive reference (below is directed graphs).

    • A <---> A
    • A <---> B
    • A ---> B, B ---> C, C ---> A

    Algorithm

    Just recursively find the same profile name at the start.

    • A <---> A
      • A --->Found A
    • A <---> B
      • A ---> B --> Found A
    • A ---> B, B ---> C, C ---> A
      • A ---> B ---> C ---> Found A

    This is naive algorithm.
    This does not scale but is simple.
    More efficient algorithm may be needed in the future.

  11. AvianY commented on Apr 10, 2018

    @AvianY
    ContributorAuthor

    I was wondering what would the command $volt list show ... ?
    Would it be ok, that by itself it shows the top level plugins and other profiles that are included?
    If the user desires to view top level plugins as well as all the plugins added with other profiles, an additional switch -e (expand) could be introduced. Like so $volt list -e.

    what do you think?

  12. tyru commented on Apr 10, 2018

    @tyru
    Member

    The question seems unrelated to this issue.
    Please file a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions