update readme
This commit is contained in:
26
README.md
26
README.md
@ -1,7 +1,5 @@
|
|||||||
# dep
|
# dep
|
||||||
|
|
||||||
> This readme is a work in progress.
|
|
||||||
|
|
||||||
A versatile, declarative and correct [neovim][2] package manager in [Lua][3].
|
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
|
Originally written for personal use by [luaneko][4]. Adapted by [squibid][5] for
|
||||||
general use.
|
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
|
1. `versatile` - packages can be declared in any Lua file in any order of your
|
||||||
liking.
|
liking.
|
||||||
2. `declarative` - packages are declared using simple Lua tables.
|
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,
|
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
|
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).
|
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.
|
practice.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
@ -35,7 +34,7 @@ practice.
|
|||||||
local path = vim.fn.stdpath("data") .. "/site/pack/deps/opt/dep"
|
local path = vim.fn.stdpath("data") .. "/site/pack/deps/opt/dep"
|
||||||
|
|
||||||
if vim.fn.empty(vim.fn.glob(path)) > 0 then
|
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
|
end
|
||||||
|
|
||||||
vim.cmd("packadd dep")
|
vim.cmd("packadd dep")
|
||||||
@ -57,6 +56,7 @@ require "dep" {
|
|||||||
- `:DepClean` - cleans removed packages.
|
- `:DepClean` - cleans removed packages.
|
||||||
- `:DepReload` - reloads all packages.
|
- `:DepReload` - reloads all packages.
|
||||||
- `:DepLog` - opens the log file.
|
- `:DepLog` - opens the log file.
|
||||||
|
- `:DepUi` - opens the ui.
|
||||||
|
|
||||||
## Package specification
|
## Package specification
|
||||||
|
|
||||||
@ -83,8 +83,9 @@ A package must be declared in the following format.
|
|||||||
os.execute(...)
|
os.execute(...)
|
||||||
end,
|
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)
|
lazy = function(load)
|
||||||
|
load:cmd("LoadPackage")
|
||||||
end,
|
end,
|
||||||
|
|
||||||
-- [string] Overrides the short name of the package.
|
-- [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.
|
-- [string] Overrides the URL of the git repository to clone.
|
||||||
-- Defaults to "https://github.com/{full_name}.git".
|
-- 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
|
-- [string] Overrides the source in which the package is gotten
|
||||||
-- from. This is not set by default.
|
-- 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
|
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
|
## Separating code into modules
|
||||||
|
|
||||||
@ -378,6 +379,13 @@ return {
|
|||||||
Package specifications from other modules can be loaded using the `modules` option.
|
Package specifications from other modules can be loaded using the `modules` option.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
|
require "dep" {
|
||||||
|
modules = {
|
||||||
|
prefix = "packages"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- the above is equivalent to
|
||||||
require "dep" {
|
require "dep" {
|
||||||
modules = {
|
modules = {
|
||||||
prefix = "packages.",
|
prefix = "packages.",
|
||||||
@ -386,7 +394,7 @@ require "dep" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-- the above is equivalent to
|
-- or
|
||||||
require "dep" {
|
require "dep" {
|
||||||
modules = {
|
modules = {
|
||||||
"packages.search",
|
"packages.search",
|
||||||
|
Reference in New Issue
Block a user