diff --git a/doc/snacks-gitbrowse.txt b/doc/snacks-gitbrowse.txt index 29346284..a993c14a 100644 --- a/doc/snacks-gitbrowse.txt +++ b/doc/snacks-gitbrowse.txt @@ -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}", 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}", + }, }, } < diff --git a/doc/snacks-image.txt b/doc/snacks-image.txt index a0890ae5..e8e1a98d 100644 --- a/doc/snacks-image.txt +++ b/doc/snacks-image.txt @@ -126,6 +126,9 @@ In case of issues, make sure to run `:checkhealth snacks`. float = true, max_width = 80, 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" }, -- 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 convert = { 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 mermaid = function() 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, ---@type table magick = { - default = { "{src}[0]", "-scale", "1920x1080>" }, - math = { "-density", 600, "{src}[0]", "-trim" }, - pdf = { "-density", 300, "{src}[0]", "-background", "white", "-alpha", "remove", "-trim" }, + default = { "{src}[0]", "-scale", "1920x1080>" }, -- default for raster images + vector = { "-density", 192, "{src}[0]" }, -- used by vector images like svg + 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 ---@class snacks.image.Opts ---@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 width? number ---@field min_width? number diff --git a/doc/snacks-picker.txt b/doc/snacks-picker.txt index 66cda9df..7466aa27 100644 --- a/doc/snacks-picker.txt +++ b/doc/snacks-picker.txt @@ -348,11 +348,11 @@ below. ---@class snacks.picker.previewers.Config previewers = { 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 }, 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 ...` }, file = { @@ -1302,7 +1302,7 @@ GIT_DIFF *snacks-picker-sources-git_diff* { finder = "git_diff", format = "file", - preview = "preview", + preview = "diff", } < @@ -1622,11 +1622,14 @@ KEYMAPS *snacks-picker-sources-keymaps* plugs = false, ["local"] = true, modes = { "n", "v", "x", "s", "o", "i", "c", "t" }, + ---@param picker snacks.Picker confirm = function(picker, item) - picker:close() - if item then - vim.api.nvim_input(item.item.lhs) - end + picker:norm(function() + if item then + picker:close() + vim.api.nvim_input(item.item.lhs) + end + end) end, actions = { toggle_global = function(picker) diff --git a/doc/snacks-words.txt b/doc/snacks-words.txt index 3621ecbc..8d63bc52 100644 --- a/doc/snacks-words.txt +++ b/doc/snacks-words.txt @@ -46,6 +46,9 @@ Auto-show LSP references and quickly navigate between them foldopen = true, -- open folds after jumping jumplist = true, -- set jump point before jumping 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()* >lua - ---@param count number + ---@param count? number ---@param cycle? boolean Snacks.words.jump(count, cycle) < diff --git a/doc/snacks.nvim.txt b/doc/snacks.nvim.txt index a8cbb25d..d3fc026d 100644 --- a/doc/snacks.nvim.txt +++ b/doc/snacks.nvim.txt @@ -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* diff --git a/docs/picker.md b/docs/picker.md index 07000559..8b7a0857 100644 --- a/docs/picker.md +++ b/docs/picker.md @@ -168,11 +168,11 @@ Snacks.picker.pick({source = "files", ...}) ---@class snacks.picker.previewers.Config previewers = { 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 }, 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 ...` }, file = { @@ -1094,7 +1094,7 @@ Neovim commands { finder = "git_diff", format = "file", - preview = "preview", + preview = "diff", } ```