Skip to content

Conversation

@MageJohn
Copy link

Overview

Right now if you want to use something other than GitHub over HTTPS to get plugins you need to specify the full URL; if you want to do this with more than one or two plugins it will get messy. This PR adds a two keys to the config dictionary for minpac#init and one key to the config for minpac#add that try to fix this problem.

Use cases

  • Change all your plugins to update over SSH.
  • Remove all long form urls and just pass an extra key to minpac#add, which makes for a cleaner vimrc/init.vim
  • Future proofs the plugin; if the plugin ecosystem changes to no longer have most plugins on GitHub, no update to minpac is required to support it.

What's been added

The keys for minpac#init are 'site' and 'sites'. 'sites' is a dictionary whose keys are short names for sites, and whose values are the base url for the corresponding site; the default names are include 'github', whose value is 'https://github.com/'. See the code for the others. 'site' is a key from the 'sites' dictionary, default 'github'. This is used as the default site for short form URLs passed to minpac#add.

The key for minpac#add is also a key from the 'sites' dictionary, and overrides the value set by minpac#init.

I've also added tests for the new configuration options.

To-do

This will probably need documentation before it's merged.

Tests added to Test_minpac_init and Test_minpac_add. No tests in Test_minpac_update yet because they require setting up or finding a suitable repository on a site like Gitlab or Bitbucket, or maybe using SSH to access a GitHub repo, but that needs an SSH key.
MageJohn and others added 3 commits December 22, 2019 11:11
Co-Authored-By: Scott Stevenson <[email protected]>
Co-Authored-By: Scott Stevenson <[email protected]>
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.

2 participants