docs: moar docs

This commit is contained in:
Folke Lemaitre 2024-11-06 11:43:50 +01:00
parent 983621b0fe
commit 82ea3e68c4
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
18 changed files with 103 additions and 87 deletions

View file

@ -21,19 +21,22 @@ Table of Contents *snacks-lazygit-table-of-contents*
---@field args? string[]
---@field theme? snacks.lazygit.Theme
{
-- automatically configure lazygit to use the current colorscheme
-- and integrate edit with the current neovim instance
configure = true,
theme_path = vim.fs.normalize(vim.fn.stdpath("cache") .. "/lazygit-theme.yml"),
-- Theme for lazygit
theme = {
[241] = { fg = "Special" },
activeBorderColor = { fg = "MatchParen", bold = true },
cherryPickedCommitBgColor = { fg = "Identifier" },
cherryPickedCommitFgColor = { fg = "Function" },
defaultFgColor = { fg = "Normal" },
inactiveBorderColor = { fg = "FloatBorder" },
optionsTextColor = { fg = "Function" },
[241] = { fg = "Special" },
activeBorderColor = { fg = "MatchParen", bold = true },
cherryPickedCommitBgColor = { fg = "Identifier" },
cherryPickedCommitFgColor = { fg = "Function" },
defaultFgColor = { fg = "Normal" },
inactiveBorderColor = { fg = "FloatBorder" },
optionsTextColor = { fg = "Function" },
searchingActiveBorderColor = { fg = "MatchParen", bold = true },
selectedLineBgColor = { bg = "Visual" }, -- set to `default` to have no background colour
unstagedChangesColor = { fg = "DiagnosticError" },
selectedLineBgColor = { bg = "Visual" }, -- set to `default` to have no background colour
unstagedChangesColor = { fg = "DiagnosticError" },
},
win = {
style = "lazygit",

View file

@ -27,7 +27,7 @@ Table of Contents *snacks-notifier-table-of-contents*
---@class snacks.notifier.Config
---@field keep? fun(notif: snacks.notifier.Notif): boolean
{
timeout = 3000,
timeout = 3000, -- default timeout in ms
width = { min = 40, max = 0.4 },
height = { min = 1, max = 0.6 },
padding = true, -- add 1 cell of left/right padding to the notification window

View file

@ -11,13 +11,14 @@ Table of Contents *snacks-statuscolumn-table-of-contents*
>lua
---@class snacks.statuscolumn.Config
{
left = { "mark", "sign" },
right = { "fold", "git" },
left = { "mark", "sign" }, -- priority of signs on the left (high to low)
right = { "fold", "git" }, -- priority of signs on the right (high to low)
folds = {
open = false, -- show open fold icons
git_hl = false, -- use Git Signs hl for fold icons
},
git = {
-- patterns to match Git signs
patterns = { "GitSign", "MiniDiffSign" },
},
refresh = 50, -- refresh at most every 50ms

View file

@ -26,13 +26,15 @@ Table of Contents *snacks-toggle-table-of-contents*
---@field icon? string|{ enabled: string, disabled: string }
---@field color? string|{ enabled: string, disabled: string }
{
map = vim.keymap.set,
which_key = true,
notify = true,
map = vim.keymap.set, -- keymap.set function to use
which_key = true, -- integrate with which-key to show enabled/disabled icons and colors
notify = true, -- show a notification when toggling
-- icons for enabled/disabled states
icon = {
enabled = " ",
disabled = " ",
},
-- colors for enabled/disabled states
color = {
enabled = "green",
disabled = "yellow",

View file

@ -30,20 +30,19 @@ Table of Contents *snacks-win-table-of-contents*
>lua
---@class snacks.win.Config: vim.api.keyset.win_config
---@field style? string merges with config from `Snacks.config.views[view]`
---@field style? string merges with config from `Snacks.config.styles[style]`
---@field show? boolean Show the window immediately (default: true)
---@field minimal? boolean
---@field minimal? boolean Disable a bunch of options to make the window minimal (default: true)
---@field position? "float"|"bottom"|"top"|"left"|"right"
---@field buf? number
---@field file? string
---@field enter? boolean
---@field backdrop? number|false
---@field win? vim.api.keyset.win_config
---@field wo? vim.wo
---@field bo? vim.bo
---@field keys? table<string, false|string|fun(self: snacks.win)|snacks.win.Keys>
---@field on_buf? fun(self: snacks.win)
---@field on_win? fun(self: snacks.win)
---@field buf? number If set, use this buffer instead of creating a new one
---@field file? string If set, use this file instead of creating a new buffer
---@field enter? boolean Enter the window after opening (default: false)
---@field backdrop? number|false Opacity of the backdrop (default: 60)
---@field wo? vim.wo window options
---@field bo? vim.bo buffer options
---@field keys? table<string, false|string|fun(self: snacks.win)|snacks.win.Keys> Key mappings
---@field on_buf? fun(self: snacks.win) Callback after opening the buffer
---@field on_win? fun(self: snacks.win) Callback after opening the window
{
show = true,
relative = "editor",

View file

@ -14,8 +14,8 @@ Table of Contents *snacks-words-table-of-contents*
>lua
---@class snacks.words.Config
{
enabled = true,
debounce = 200,
enabled = true, -- enable/disable the plugin
debounce = 200, -- time in ms to wait before updating
}
<

View file

@ -9,19 +9,22 @@
---@field args? string[]
---@field theme? snacks.lazygit.Theme
{
-- automatically configure lazygit to use the current colorscheme
-- and integrate edit with the current neovim instance
configure = true,
theme_path = vim.fs.normalize(vim.fn.stdpath("cache") .. "/lazygit-theme.yml"),
-- Theme for lazygit
theme = {
[241] = { fg = "Special" },
activeBorderColor = { fg = "MatchParen", bold = true },
cherryPickedCommitBgColor = { fg = "Identifier" },
cherryPickedCommitFgColor = { fg = "Function" },
defaultFgColor = { fg = "Normal" },
inactiveBorderColor = { fg = "FloatBorder" },
optionsTextColor = { fg = "Function" },
[241] = { fg = "Special" },
activeBorderColor = { fg = "MatchParen", bold = true },
cherryPickedCommitBgColor = { fg = "Identifier" },
cherryPickedCommitFgColor = { fg = "Function" },
defaultFgColor = { fg = "Normal" },
inactiveBorderColor = { fg = "FloatBorder" },
optionsTextColor = { fg = "Function" },
searchingActiveBorderColor = { fg = "MatchParen", bold = true },
selectedLineBgColor = { bg = "Visual" }, -- set to `default` to have no background colour
unstagedChangesColor = { fg = "DiagnosticError" },
selectedLineBgColor = { bg = "Visual" }, -- set to `default` to have no background colour
unstagedChangesColor = { fg = "DiagnosticError" },
},
win = {
style = "lazygit",

View file

@ -8,7 +8,7 @@
---@class snacks.notifier.Config
---@field keep? fun(notif: snacks.notifier.Notif): boolean
{
timeout = 3000,
timeout = 3000, -- default timeout in ms
width = { min = 40, max = 0.4 },
height = { min = 1, max = 0.6 },
padding = true, -- add 1 cell of left/right padding to the notification window

View file

@ -7,13 +7,14 @@
```lua
---@class snacks.statuscolumn.Config
{
left = { "mark", "sign" },
right = { "fold", "git" },
left = { "mark", "sign" }, -- priority of signs on the left (high to low)
right = { "fold", "git" }, -- priority of signs on the right (high to low)
folds = {
open = false, -- show open fold icons
git_hl = false, -- use Git Signs hl for fold icons
},
git = {
-- patterns to match Git signs
patterns = { "GitSign", "MiniDiffSign" },
},
refresh = 50, -- refresh at most every 50ms

View file

@ -9,13 +9,15 @@
---@field icon? string|{ enabled: string, disabled: string }
---@field color? string|{ enabled: string, disabled: string }
{
map = vim.keymap.set,
which_key = true,
notify = true,
map = vim.keymap.set, -- keymap.set function to use
which_key = true, -- integrate with which-key to show enabled/disabled icons and colors
notify = true, -- show a notification when toggling
-- icons for enabled/disabled states
icon = {
enabled = " ",
disabled = " ",
},
-- colors for enabled/disabled states
color = {
enabled = "green",
disabled = "yellow",

View file

@ -6,20 +6,19 @@
```lua
---@class snacks.win.Config: vim.api.keyset.win_config
---@field style? string merges with config from `Snacks.config.views[view]`
---@field style? string merges with config from `Snacks.config.styles[style]`
---@field show? boolean Show the window immediately (default: true)
---@field minimal? boolean
---@field minimal? boolean Disable a bunch of options to make the window minimal (default: true)
---@field position? "float"|"bottom"|"top"|"left"|"right"
---@field buf? number
---@field file? string
---@field enter? boolean
---@field backdrop? number|false
---@field win? vim.api.keyset.win_config
---@field wo? vim.wo
---@field bo? vim.bo
---@field keys? table<string, false|string|fun(self: snacks.win)|snacks.win.Keys>
---@field on_buf? fun(self: snacks.win)
---@field on_win? fun(self: snacks.win)
---@field buf? number If set, use this buffer instead of creating a new one
---@field file? string If set, use this file instead of creating a new buffer
---@field enter? boolean Enter the window after opening (default: false)
---@field backdrop? number|false Opacity of the backdrop (default: 60)
---@field wo? vim.wo window options
---@field bo? vim.bo buffer options
---@field keys? table<string, false|string|fun(self: snacks.win)|snacks.win.Keys> Key mappings
---@field on_buf? fun(self: snacks.win) Callback after opening the buffer
---@field on_win? fun(self: snacks.win) Callback after opening the window
{
show = true,
relative = "editor",

View file

@ -7,8 +7,8 @@
```lua
---@class snacks.words.Config
{
enabled = true,
debounce = 200,
enabled = true, -- enable/disable the plugin
debounce = 200, -- time in ms to wait before updating
}
```

View file

@ -24,19 +24,23 @@ local M = setmetatable({}, {
---@field args? string[]
---@field theme? snacks.lazygit.Theme
local defaults = {
-- automatically configure lazygit to use the current colorscheme
-- and integrate edit with the current neovim instance
configure = true,
theme_path = vim.fs.normalize(vim.fn.stdpath("cache") .. "/lazygit-theme.yml"),
-- Theme for lazygit
-- stylua: ignore
theme = {
[241] = { fg = "Special" },
activeBorderColor = { fg = "MatchParen", bold = true },
cherryPickedCommitBgColor = { fg = "Identifier" },
cherryPickedCommitFgColor = { fg = "Function" },
defaultFgColor = { fg = "Normal" },
inactiveBorderColor = { fg = "FloatBorder" },
optionsTextColor = { fg = "Function" },
[241] = { fg = "Special" },
activeBorderColor = { fg = "MatchParen", bold = true },
cherryPickedCommitBgColor = { fg = "Identifier" },
cherryPickedCommitFgColor = { fg = "Function" },
defaultFgColor = { fg = "Normal" },
inactiveBorderColor = { fg = "FloatBorder" },
optionsTextColor = { fg = "Function" },
searchingActiveBorderColor = { fg = "MatchParen", bold = true },
selectedLineBgColor = { bg = "Visual" }, -- set to `default` to have no background colour
unstagedChangesColor = { fg = "DiagnosticError" },
selectedLineBgColor = { bg = "Visual" }, -- set to `default` to have no background colour
unstagedChangesColor = { fg = "DiagnosticError" },
},
win = {
style = "lazygit",

View file

@ -65,7 +65,7 @@ M.styles = {
---@class snacks.notifier.Config
---@field keep? fun(notif: snacks.notifier.Notif): boolean
local defaults = {
timeout = 3000,
timeout = 3000, -- default timeout in ms
width = { min = 40, max = 0.4 },
height = { min = 1, max = 0.6 },
padding = true, -- add 1 cell of left/right padding to the notification window

View file

@ -9,13 +9,14 @@ local M = setmetatable({}, {
---@class snacks.statuscolumn.Config
local defaults = {
left = { "mark", "sign" },
right = { "fold", "git" },
left = { "mark", "sign" }, -- priority of signs on the left (high to low)
right = { "fold", "git" }, -- priority of signs on the right (high to low)
folds = {
open = false, -- show open fold icons
git_hl = false, -- use Git Signs hl for fold icons
},
git = {
-- patterns to match Git signs
patterns = { "GitSign", "MiniDiffSign" },
},
refresh = 50, -- refresh at most every 50ms

View file

@ -11,13 +11,15 @@ local M = setmetatable({}, {
---@field icon? string|{ enabled: string, disabled: string }
---@field color? string|{ enabled: string, disabled: string }
local defaults = {
map = vim.keymap.set,
which_key = true,
notify = true,
map = vim.keymap.set, -- keymap.set function to use
which_key = true, -- integrate with which-key to show enabled/disabled icons and colors
notify = true, -- show a notification when toggling
-- icons for enabled/disabled states
icon = {
enabled = "",
disabled = "",
},
-- colors for enabled/disabled states
color = {
enabled = "green",
disabled = "yellow",

View file

@ -18,20 +18,19 @@ local M = setmetatable({}, {
---@field mode? string|string[]
---@class snacks.win.Config: vim.api.keyset.win_config
---@field style? string merges with config from `Snacks.config.views[view]`
---@field style? string merges with config from `Snacks.config.styles[style]`
---@field show? boolean Show the window immediately (default: true)
---@field minimal? boolean
---@field minimal? boolean Disable a bunch of options to make the window minimal (default: true)
---@field position? "float"|"bottom"|"top"|"left"|"right"
---@field buf? number
---@field file? string
---@field enter? boolean
---@field backdrop? number|false
---@field win? vim.api.keyset.win_config
---@field wo? vim.wo
---@field bo? vim.bo
---@field keys? table<string, false|string|fun(self: snacks.win)|snacks.win.Keys>
---@field on_buf? fun(self: snacks.win)
---@field on_win? fun(self: snacks.win)
---@field buf? number If set, use this buffer instead of creating a new one
---@field file? string If set, use this file instead of creating a new buffer
---@field enter? boolean Enter the window after opening (default: false)
---@field backdrop? number|false Opacity of the backdrop (default: 60)
---@field wo? vim.wo window options
---@field bo? vim.bo buffer options
---@field keys? table<string, false|string|fun(self: snacks.win)|snacks.win.Keys> Key mappings
---@field on_buf? fun(self: snacks.win) Callback after opening the buffer
---@field on_win? fun(self: snacks.win) Callback after opening the window
local defaults = {
show = true,
relative = "editor",

View file

@ -7,8 +7,8 @@ local M = {}
---@class snacks.words.Config
local defaults = {
enabled = true,
debounce = 200,
enabled = true, -- enable/disable the plugin
debounce = 200, -- time in ms to wait before updating
}
local config = Snacks.config.get("words", defaults)