Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

[FEATURE] Override doom-nvim packer dependencies with local clones or forks #251

Closed
connorgmeehan opened this issue Nov 20, 2021 · 2 comments
Milestone

Comments

@connorgmeehan
Copy link
Collaborator

Feature Request

Users should be able to override a plugins source using a table inside of doom_plugins.lua.

This is important for users who want to use a different fork, or a locally developed version of a plugin.

How would it work

Users should be able to specify a different path that packer will import from. This could live in doom_plugins.lua.

module.plugin_overrides = {
     { 'nvim-treesitter/nvim-tree-docs', 'mygithubaccount/my-nvim-tree-docs-fork' }, -- Use github link
     { 'nvim-treesitter/nvim-tree-docs', '~/projects/nvim_plugins/my-nvim-tree-docs-fork' } -- Use local path
}

Implementation

Then we wrap the packer use function

local wrap_packer = function(packer_use)
  return function(spec)
    local source_package = spec[1]
    if utils.has_value(plugin_overrides, source_package) then
       -- ... replace spec[1] with second value from plugin_overrides
       spec.commit = nil -- Disable pinned packer dependency 
    end
    packer_use(spec)
  end
end

local use = wrap_packer(packer.use) 

use({
    'nvim-treesitter/nvim-tree-docs',
    -- ... config etc
})

This will swap out the packer dependency path for one specified in module.plugin_overrides.


This feature request responds to #181

@connorgmeehan connorgmeehan changed the title [FEATURE] Override doom-nvim dependencies with local/forks [FEATURE] Override doom-nvim dependencies with local clones or forks Nov 20, 2021
@connorgmeehan connorgmeehan changed the title [FEATURE] Override doom-nvim dependencies with local clones or forks [FEATURE] Override doom-nvim packer dependencies with local clones or forks Nov 20, 2021
@molleweide
Copy link
Contributor

Holy shit cool!!!

@NTBBloodbath NTBBloodbath added this to the 3.3.0 milestone Nov 20, 2021
@connorgmeehan
Copy link
Collaborator Author

Closed due to v4.0.0 alpha changes in next branch

@connorgmeehan connorgmeehan modified the milestones: 3.3.0, 4.0.0 May 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants