pin the correct repo to the top of the plugin list

This commit is contained in:
2023-04-30 19:49:01 -04:00
parent 5b7b7f610f
commit 3d20ae8d2a
4 changed files with 12 additions and 136 deletions

103
README.md
View File

@ -287,97 +287,6 @@ require "dep" {
}
```
## Separating code into modules
Suppose you split your `init.lua` into two files `packages/search.lua` and
`packages/vcs.lua`, which declare the packages [telescope.nvim][6] and [vim-fugitive][7] respectively.
```lua
-- ~/.config/nvim/lua/packages/search.lua:
return {
{
"nvim-telescope/telescope.nvim",
requires = "nvim-lua/plenary.nvim"
}
}
```
```lua
-- ~/.config/nvim/lua/packages/vcs.lua:
return {
"tpope/vim-fugitive"
}
```
Package specifications from other modules can be loaded using the `modules` option.
```lua
require "dep" {
modules = {
prefix = "packages.",
"search",
"vcs"
}
}
-- the above is equivalent to
require "dep" {
modules = {
"packages.search",
"packages.vcs"
}
}
-- which is equivalent to
local packages = {}
for _, package in ipairs(require "packages.search") do
table.insert(packages, package)
end
for _, package in ipairs(require "packages.vcs") do
table.insert(packages, package)
end
require("dep")(packages)
-- which is ultimately equivalent to
require "dep" {
{
"nvim-telescope/telescope.nvim",
requires = "nvim-lua/plenary.nvim"
},
"tpope/vim-fugitive"
}
-- all of the above are guaranteed to load plenary.nvim before telescope.nvim.
-- order of telescope.nvim and vim-fugitive is consistent but unspecified.
```
Entire modules can be marked as disabled, which disables all top-level packages declared in that module.
```lua
return {
disable = true,
{
"user/package",
disabled = true, -- implied by module
requires = {
{
"user/dependency",
-- disabled = true -- not implied
}
},
deps = {
{
"user/dependent",
disabled = true -- implied by dependency
}
}
}
}
```
## Miscellaneous configuration
dep accepts configuration parameters as named fields in the package list.
@ -390,14 +299,10 @@ require "dep" {
-- "always": synchronize all packages on startup
sync = "new",
-- [array] Specifies the modules to load package specifications from.
-- Defaults to an empty table.
-- Items can be either an array of package specifications,
-- or a string that indicates the name of the module from which the array of package specifications is loaded.
modules = {
-- [string] Prefix string to prepend to all module names.
prefix = "",
},
-- [function] Callback when dep is (re)loaded
-- if a table is returned it will be read as a table of config specs
load = function()
end
-- list of package specs...
}