mirror of
https://github.com/folke/snacks.nvim
synced 2025-07-07 21:25:11 +00:00
docs: docgen
This commit is contained in:
parent
bd6a62af12
commit
b82816e3ea
6 changed files with 38 additions and 15 deletions
|
@ -89,6 +89,12 @@ Open the repo of the active file in the browser (e.g., GitHub)
|
||||||
permalink = "/src/{commit}/{file}#lines-{line_start}-L{line_end}",
|
permalink = "/src/{commit}/{file}#lines-{line_start}-L{line_end}",
|
||||||
commit = "/commits/{commit}",
|
commit = "/commits/{commit}",
|
||||||
},
|
},
|
||||||
|
["git.sr.ht"] = {
|
||||||
|
branch = "/tree/{branch}",
|
||||||
|
file = "/tree/{branch}/item/{file}",
|
||||||
|
permalink = "/tree/{commit}/item/{file}#L{line_start}",
|
||||||
|
commit = "/commit/{commit}",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
<
|
<
|
||||||
|
|
|
@ -126,6 +126,9 @@ In case of issues, make sure to run `:checkhealth snacks`.
|
||||||
float = true,
|
float = true,
|
||||||
max_width = 80,
|
max_width = 80,
|
||||||
max_height = 40,
|
max_height = 40,
|
||||||
|
-- Set to `true`, to conceal the image text when rendering inline.
|
||||||
|
-- (experimental)
|
||||||
|
conceal = false,
|
||||||
},
|
},
|
||||||
img_dirs = { "img", "images", "assets", "static", "public", "media", "attachments" },
|
img_dirs = { "img", "images", "assets", "static", "public", "media", "attachments" },
|
||||||
-- window options applied to windows displaying image buffers
|
-- window options applied to windows displaying image buffers
|
||||||
|
@ -151,6 +154,12 @@ In case of issues, make sure to run `:checkhealth snacks`.
|
||||||
---@class snacks.image.convert.Config
|
---@class snacks.image.convert.Config
|
||||||
convert = {
|
convert = {
|
||||||
notify = true, -- show a notification on error
|
notify = true, -- show a notification on error
|
||||||
|
math = {
|
||||||
|
font_size = "Large", -- see https://www.sascha-frank.com/latex-font-size.html
|
||||||
|
-- for latex documents, the doc packages are included automatically,
|
||||||
|
-- but you can add more packages here. Useful for markdown documents.
|
||||||
|
packages = { "amsmath", "amssymb", "amsfonts", "amscd", "mathtools", "physics", "siunitx", "mhchem" },
|
||||||
|
},
|
||||||
---@type snacks.image.args
|
---@type snacks.image.args
|
||||||
mermaid = function()
|
mermaid = function()
|
||||||
local theme = vim.o.background == "light" and "neutral" or "dark"
|
local theme = vim.o.background == "light" and "neutral" or "dark"
|
||||||
|
@ -158,9 +167,10 @@ In case of issues, make sure to run `:checkhealth snacks`.
|
||||||
end,
|
end,
|
||||||
---@type table<string,snacks.image.args>
|
---@type table<string,snacks.image.args>
|
||||||
magick = {
|
magick = {
|
||||||
default = { "{src}[0]", "-scale", "1920x1080>" },
|
default = { "{src}[0]", "-scale", "1920x1080>" }, -- default for raster images
|
||||||
math = { "-density", 600, "{src}[0]", "-trim" },
|
vector = { "-density", 192, "{src}[0]" }, -- used by vector images like svg
|
||||||
pdf = { "-density", 300, "{src}[0]", "-background", "white", "-alpha", "remove", "-trim" },
|
math = { "-density", 192, "{src}[0]", "-trim" },
|
||||||
|
pdf = { "-density", 192, "{src}[0]", "-background", "white", "-alpha", "remove", "-trim" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -214,6 +224,7 @@ SNACKS_IMAGE *snacks-image-styles-snacks_image*
|
||||||
>lua
|
>lua
|
||||||
---@class snacks.image.Opts
|
---@class snacks.image.Opts
|
||||||
---@field pos? snacks.image.Pos (row, col) (1,0)-indexed. defaults to the top-left corner
|
---@field pos? snacks.image.Pos (row, col) (1,0)-indexed. defaults to the top-left corner
|
||||||
|
---@field range? Range4
|
||||||
---@field inline? boolean render the image inline in the buffer
|
---@field inline? boolean render the image inline in the buffer
|
||||||
---@field width? number
|
---@field width? number
|
||||||
---@field min_width? number
|
---@field min_width? number
|
||||||
|
|
|
@ -348,11 +348,11 @@ below.
|
||||||
---@class snacks.picker.previewers.Config
|
---@class snacks.picker.previewers.Config
|
||||||
previewers = {
|
previewers = {
|
||||||
diff = {
|
diff = {
|
||||||
native = false, -- use native (terminal) or Neovim for previewing git diffs and commits
|
builtin = true, -- use Neovim for previewing diffs (true) or use an external tool (false)
|
||||||
cmd = { "delta" }, -- example to show a diff with delta
|
cmd = { "delta" }, -- example to show a diff with delta
|
||||||
},
|
},
|
||||||
git = {
|
git = {
|
||||||
native = false, -- use native (terminal) or Neovim for previewing git diffs and commits
|
builtin = true, -- use Neovim for previewing git output (true) or use git (false)
|
||||||
args = {}, -- additional arguments passed to the git command. Useful to set pager options usin `-c ...`
|
args = {}, -- additional arguments passed to the git command. Useful to set pager options usin `-c ...`
|
||||||
},
|
},
|
||||||
file = {
|
file = {
|
||||||
|
@ -1302,7 +1302,7 @@ GIT_DIFF *snacks-picker-sources-git_diff*
|
||||||
{
|
{
|
||||||
finder = "git_diff",
|
finder = "git_diff",
|
||||||
format = "file",
|
format = "file",
|
||||||
preview = "preview",
|
preview = "diff",
|
||||||
}
|
}
|
||||||
<
|
<
|
||||||
|
|
||||||
|
@ -1622,11 +1622,14 @@ KEYMAPS *snacks-picker-sources-keymaps*
|
||||||
plugs = false,
|
plugs = false,
|
||||||
["local"] = true,
|
["local"] = true,
|
||||||
modes = { "n", "v", "x", "s", "o", "i", "c", "t" },
|
modes = { "n", "v", "x", "s", "o", "i", "c", "t" },
|
||||||
|
---@param picker snacks.Picker
|
||||||
confirm = function(picker, item)
|
confirm = function(picker, item)
|
||||||
picker:close()
|
picker:norm(function()
|
||||||
if item then
|
if item then
|
||||||
vim.api.nvim_input(item.item.lhs)
|
picker:close()
|
||||||
end
|
vim.api.nvim_input(item.item.lhs)
|
||||||
|
end
|
||||||
|
end)
|
||||||
end,
|
end,
|
||||||
actions = {
|
actions = {
|
||||||
toggle_global = function(picker)
|
toggle_global = function(picker)
|
||||||
|
|
|
@ -46,6 +46,9 @@ Auto-show LSP references and quickly navigate between them
|
||||||
foldopen = true, -- open folds after jumping
|
foldopen = true, -- open folds after jumping
|
||||||
jumplist = true, -- set jump point before jumping
|
jumplist = true, -- set jump point before jumping
|
||||||
modes = { "n", "i", "c" }, -- modes to show references
|
modes = { "n", "i", "c" }, -- modes to show references
|
||||||
|
filter = function(buf) -- what buffers to enable `snacks.words`
|
||||||
|
return vim.g.snacks_words ~= false and vim.b[buf].snacks_words ~= false
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
<
|
<
|
||||||
|
|
||||||
|
@ -86,7 +89,7 @@ Auto-show LSP references and quickly navigate between them
|
||||||
`Snacks.words.jump()` *Snacks.words.jump()*
|
`Snacks.words.jump()` *Snacks.words.jump()*
|
||||||
|
|
||||||
>lua
|
>lua
|
||||||
---@param count number
|
---@param count? number
|
||||||
---@param cycle? boolean
|
---@param cycle? boolean
|
||||||
Snacks.words.jump(count, cycle)
|
Snacks.words.jump(count, cycle)
|
||||||
<
|
<
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
*snacks.nvim.txt* For Neovim Last change: 2025 February 19
|
*snacks* For Neovim Last change: 2025 February 19
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Table of Contents *snacks.nvim-table-of-contents*
|
Table of Contents *snacks.nvim-table-of-contents*
|
||||||
|
|
|
@ -168,11 +168,11 @@ Snacks.picker.pick({source = "files", ...})
|
||||||
---@class snacks.picker.previewers.Config
|
---@class snacks.picker.previewers.Config
|
||||||
previewers = {
|
previewers = {
|
||||||
diff = {
|
diff = {
|
||||||
native = false, -- use native (terminal) or Neovim for previewing git diffs and commits
|
builtin = true, -- use Neovim for previewing diffs (true) or use an external tool (false)
|
||||||
cmd = { "delta" }, -- example to show a diff with delta
|
cmd = { "delta" }, -- example to show a diff with delta
|
||||||
},
|
},
|
||||||
git = {
|
git = {
|
||||||
native = false, -- use native (terminal) or Neovim for previewing git diffs and commits
|
builtin = true, -- use Neovim for previewing git output (true) or use git (false)
|
||||||
args = {}, -- additional arguments passed to the git command. Useful to set pager options usin `-c ...`
|
args = {}, -- additional arguments passed to the git command. Useful to set pager options usin `-c ...`
|
||||||
},
|
},
|
||||||
file = {
|
file = {
|
||||||
|
@ -1094,7 +1094,7 @@ Neovim commands
|
||||||
{
|
{
|
||||||
finder = "git_diff",
|
finder = "git_diff",
|
||||||
format = "file",
|
format = "file",
|
||||||
preview = "preview",
|
preview = "diff",
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue