From 3d20ae8d2ac131aa2e2d2064c91ae31c800d8ea9 Mon Sep 17 00:00:00 2001 From: Squibid Date: Sun, 30 Apr 2023 19:49:01 -0400 Subject: pin the correct repo to the top of the plugin list --- README.md | 103 +++----------------------------------------------------------- 1 file changed, 4 insertions(+), 99 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 808821e..a77c576 100644 --- a/README.md +++ b/README.md @@ -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... } -- cgit v1.2.1