update readme

This commit is contained in:
2025-07-01 23:34:32 -04:00
parent d406ee18f2
commit 26ef7289f6

View File

@ -1,7 +1,5 @@
# dep
> This readme is a work in progress.
A versatile, declarative and correct [neovim][2] package manager in [Lua][3].
Originally written for personal use by [luaneko][4]. Adapted by [squibid][5] for
general use.
@ -11,13 +9,14 @@ What does that mean?
1. `versatile` - packages can be declared in any Lua file in any order of your
liking.
2. `declarative` - packages are declared using simple Lua tables.
3. `correct` - packages are always loaded in a correct and consistent order.
3. `correct` - packages are always loaded in a correct and consistent order
(barring any lazy loading).
In addition to the above dep has been built to be completely in control of you,
the user. With the help of lazy loading you can choose when your plugin loads
down to the finest detail (examples may be found below).
See also squibid's [neovim-configs][10] for an example of how dep can be used in
See also squibid's [neovim-config][10] for an example of how dep can be used in
practice.
## Requirements
@ -35,7 +34,7 @@ practice.
local path = vim.fn.stdpath("data") .. "/site/pack/deps/opt/dep"
if vim.fn.empty(vim.fn.glob(path)) > 0 then
vim.fn.system({ "git", "clone", "--depth=1", "https://git.squi.bid/dep", path })
vim.fn.system({ "git", "clone", "--depth=1", "https://git.squi.bid/squibid/dep", path })
end
vim.cmd("packadd dep")
@ -57,6 +56,7 @@ require "dep" {
- `:DepClean` - cleans removed packages.
- `:DepReload` - reloads all packages.
- `:DepLog` - opens the log file.
- `:DepUi` - opens the ui.
## Package specification
@ -83,8 +83,9 @@ A package must be declared in the following format.
os.execute(...)
end,
-- [function] Code used to determine when the package should be loaded.
-- [function|true] Code used to determine when the package should be loaded.
lazy = function(load)
load:cmd("LoadPackage")
end,
-- [string] Overrides the short name of the package.
@ -93,7 +94,7 @@ A package must be declared in the following format.
-- [string] Overrides the URL of the git repository to clone.
-- Defaults to "https://github.com/{full_name}.git".
url = "https://git.chiya.dev/user/package.git",
url = "https://git.squi.bid/user/package.git",
-- [string] Overrides the source in which the package is gotten
-- from. This is not set by default.
@ -351,7 +352,7 @@ require "dep" {
```
If you're in the need of a deeper understanding of how the utils work go check
out `lua/lazy/utils.lua` for the source code.
out `lua/lazy/loader/init.lua` for the source code.
## Separating code into modules
@ -378,6 +379,13 @@ return {
Package specifications from other modules can be loaded using the `modules` option.
```lua
require "dep" {
modules = {
prefix = "packages"
}
}
-- the above is equivalent to
require "dep" {
modules = {
prefix = "packages.",
@ -386,7 +394,7 @@ require "dep" {
}
}
-- the above is equivalent to
-- or
require "dep" {
modules = {
"packages.search",