github folke/snacks.nvim v2.21.0

latest releases: stable, v2.22.0
24 days ago

2.21.0 (2025-02-20)

Features

  • added new image snacks plugin for the kitty graphics protocol (4e4e630)
  • bigfile: configurable average line length (default = 1000). Useful for minified files. Closes #576. Closes #372 (7fa92a2)
  • compat: added svim, a compatibility layer for Neovim. Closes #1321 (bc902f7)
  • debug: graduate proc debug to Snacks.debug.cmd (eced303)
  • explorer: opts.include and opts.exclude. Closes #1068 (ab1889c)
  • explorer: added Snacks.explorer.reveal() to reveal the current file in the tree. (b4cf6bb)
  • explorer: added copy/paste (yank/paste) for files. Closes #1195 (938aee4)
  • explorer: added ctrl+f to grep in the item's directory (0454b21)
  • explorer: added ctrl+t to open a terminal in the item's directory (81f9006)
  • explorer: added diagnostics file/directory status (7f1b60d)
  • explorer: added quick nav with [, ] with d/w/e for diagnostics (d1d5585)
  • explorer: added support for live search (82c4a50)
  • explorer: allow disabling untracked git status. Closes #983 (a3b083b)
  • explorer: deal with existing buffers when renaming / deleting files. Closes #1315 (6614a2c)
  • explorer: different hl group for broken links (1989921)
  • explorer: disable fuzzy searches by default for explorer since it's too noisy and we can't sort on score due to tree view (b07788f)
  • explorer: file watching that works on all platforms (8399465)
  • explorer: focus on first file when searching in the explorer (1d4bea4)
  • explorer: git index watcher (4c12475)
  • explorer: show symlink target (dfa79e0)
  • git_log: add author filter (#1091) (8c11661)
  • gitbrowse: add support for git.sr.ht (#1297) (a3b47e5)
  • gitbrowse: open permalinks to files. Fixes #320 (#438) (2a06e4c)
  • image.doc: allow configuring the header for latex / typst inline in the document. Closes #1303 (bde3add)
  • image.doc: allow setting image.src with #set!. Closes #1276 (65f89e2)
  • image.doc: check for image.ignore in ts meta. See #1276 (29c777a)
  • image: conceal option for inline rendering (disabled by default) (684666f)
  • image: Snacks.image.hover() (5f466be)
  • image: add support for svelte (#1277) (54ab77c)
  • image: adde support for Image in jsx (95878ad)
  • image: added opts.img_dirs to configure the search path for resolving images. Closes #1222 (ad0b88d)
  • image: added Snacks.image.doc.at_cursor(). See #1108 (6348ccf)
  • image: added fallback image rendering for wezterm. Closes #1063 (9e6b1a6)
  • image: added math rendering for typst. Closes #1260 (e225823)
  • image: added proper support for tmux (b1a3b66)
  • image: added support for .image tags in neorg (59bbe8d)
  • image: added support for typst. Closes #1235 (507c183)
  • image: added support for a bunch of aditional languages (a596f8a)
  • image: added support for angle bracket urls. Closes #1209 (14a1f32)
  • image: added support for math expressions in latex and markdown doc + images in latex. Closes #1223 (1bca71a)
  • image: added support for mermaid diagrams in markdown (f8e7942)
  • image: added support for remote image viewing. Closes #1156 (#1165) (a5748ea)
  • image: added support for tsx, jsx, vue and angular (ab0ba5c)
  • image: added support for wikilink style images. Closes #1210 (3fda272)
  • image: allow customizing font size for math expressions (b052eb9)
  • image: allow customizing the default magick args for vector images (2096fcd)
  • image: allow forcing image rendering even when the terminal support detection fails (d17a6e4)
  • image: apply image window options (73366fa)
  • image: better detection of image capabilities of the terminal/mux environment (1795d4b)
  • image: better error handling + option to disable error notifications (1adfd29)
  • image: better health checks (d389c5d)
  • image: check for magick in health check (1284835)
  • image: custom src resolve function (af21ea3)
  • image: enabled pdf previews (39bf513)
  • image: floats in markdown. Closes #1151 (4e10e31)
  • image: health checks (0d5b106)
  • image: images are now properly scaled based on device DPI and image DPI. Closing #1257 (004050c)
  • image: make manual hover work correctly (942cb92)
  • image: make math packages configurable. Closes #1295 (e27ba72)
  • image: markdown inline image preview. opts.image must be enabled and terminal needs support (001f300)
  • image: refactor + css/html + beter image fitting (e35d6cd)
  • image: refactor of treesitter queries to support inline image data (0bf0c62)
  • images: added support for org-mode. Closes #1276 (10387af)
  • image: show progress indicator when converting image files (b65178b)
  • image: try resolving paths relative to the document and to the cwd. See #1203 (668cbbb)
  • image: url_decode strings (d41704f)
  • image: use tectonic when available (8d073cc)
  • image: use kitty's unicode placeholder images (7d655fe)
  • image: use search dirs to resolve file from both cwd and dirname of file. Closes #1305 (bf01460)
  • image: utility function to get a png dimensions from the file header (a6d866a)
  • matcher: call on_match after setting score (23ce529)
  • picker.actions: cmd action now always allows to edit the command. Closes #1033 (a177885)
  • picker.actions: option to disable notify for yank action. Closes #1117 (f6a807d)
  • picker.config: better source field spec (6c58b67)
  • picker.db: allow configuring the sqlite3 lib path. Closes #1025 (b990044)
  • picker.files: added ft option to filter by extension(s) (12a7ea2)
  • picker.format: opts.formatters.file.use_git_status_hl defaults to true and adds git status hl to filename (243eeca)
  • picker.git_diff: use the diff previewer for git_diff so that delta can be used. See #1302 (92786c5)
  • picker.git: add confirmation before deleting a git branch (#951) (337a3ae)
  • picker.git: add create and delete branch to git_branches (#909) (8676c40)
  • picker.git: allow passing extra args to git grep. Closes #1184 (7122a03)
  • picker.git: allow passing extra args to other git pickers (#1205) (4d46574)
  • picker.lazy: don't use grep. Parse spec files manually. Closes #972 (0928007)
  • picker.lsp: added original symbol to item.item. Closes #1171 (45a6f8d)
  • picker.lsp: use existing buffers for preview when opened (d4e6353)
  • picker.preview: allow confguring preview = {main = true, enabled = false} (1839c65)
  • picker.preview: allow passing additional args to the git preview command (910437f)
  • picker.proc: added proc debug mode (d870f16)
  • picker.undo: ctrl+y to yank added lines, ctrl+shift+y to yank deleted lines (3baf95d)
  • picker.undo: added ctrl+y to yank added lines from undo (811a24c)
  • picker.util: lua globber (97dcd9c)
  • picker.util: utility function to get all bins on the PATH (5d42c7e)
  • picker: opts.focus can be used to set default focus window. opts.enter if picker should be focused on enter. Closes #1162 (e8de28b)
  • picker: add LSP symbol range to result item (#1123) (c0481ab)
  • picker: added c-q to list (6d0d2dc)
  • picker: added git_grep picker. Closes #986 (2dc9016)
  • picker: added lsp_config source (0d4aa98)
  • picker: added treesitter symbols picker (a6beb0f)
  • picker: allow complex titles (#1112) (f200b3f)
  • picker: allow configuring file icon width. Closes #981 (52c1086)
  • picker: allow overriding default file/dir/dir_open icons. Closes #1199 (41c4391)
  • picker: default c-t keymap to open in tab (ffc6fe3)
  • picker: each window can now be toggled (also input), hidden and have auto_hide (01efab2)
  • picker: get filetype from modeline when needed. Closes #987 (5af04ab)
  • picker: image previewer using kitty graphics protocol (2b0aa93)
  • picker: new native diff mode (disabled by default). Can be used to show delta diffs for undo. Closes #1288 (d6a38ac)
  • picker: pin picker as a split to left/bottom/top/right with ctrl+z+(hjkl) (27cba53)
  • picker: renamed native -> builtin + fixed diff mode used for undo. Closes #1302 (bd6a62a)
  • scope: allow injected languages to be parsed by treesitter (#823) (aba21dd)
  • scroll: big rework to make scroll play nice with virtual lines (e71955a)
  • scroll: scroll improvements. Closes #1024 (73d2f0f)
  • statuscolumn: added mouse click handler to open/close folds. Closes #968 (98a7b64)
  • terminal: added Snacks.terminal.list(). Closes #421. Closes #759 (73c4b62)
  • terminal: added start_insert (64129e4)
  • terminal: auto_close and auto_insert. Closes #965 (bb76cae)
  • terminal: don't use deprecated vim.fn.termopen on Neovim >= 0.10 (37f6665)
  • test (520ed85)
  • toggle: allow user to add custom which-key description (#1121) (369732e)
  • treesitter: add tree boolean to toggle on/off tree symbols (#1105) (c61f9eb)
  • util: Snacks.util.winhl helper to deal with vim.wo.winhighlight (4c1d7b4)
  • util: base64 shim for Neovim < 0.10 (96f1227)
  • util: Snacks.util.color can now get the color from a list of hl groups (a33f65d)
  • util: util.spawn (a76fe13)
  • words: add filter function for user to disable specific filetypes (#1296) (d62e752)

Bug Fixes

  • all: better support for opening windows / pickers / ... on multiple tab pages. Closes #1043 (8272c1c)
  • bigfile: check that passed path is the one from the buffer (8deea64)
  • buffers: use " mark for full buffer position when set. Closes #1160 (7d350bc)
  • compat: correct Neovim 0.11 check (448a55a)
  • dashboard: allow dashboard to be the main editor window (e3ead3c)
  • dashboard: dashboard can be a main editor window (f36c70a)
  • dashboard: use Snacks.util.icon for icons. Closes #1192 (c2f06da)
  • debug: better args handling for debugging cmds (48a3fed)
  • explorer.git: always at .git directory to ignored (f7a35b8)
  • explorer.git: better git status watching (09349ec)
  • explorer.git: dont reset cursor when git status is done updating (bc87992)
  • explorer.git: vim.schedule git updates (3aad761)
  • explorer.tree: fix linux (6f5399b)
  • explorer.tree: symlink directories (e5f1e91)
  • explorer.watch: pcall watcher, since it can give errors on windows (af96818)
  • explorer: always refresh state when opening the picker since changes might have happened that were not monitored (c61114f)
  • explorer: call original on_close. Closes #971 (a0bee9f)
  • explorer: change grep in item dir keymap to leader-/. Closes #1000 (9dfa276)
  • explorer: check that picker is still open (50fa1be)
  • explorer: disable follow for explorer search by default. No longer needed. Link directories may show as files then though, but that's not an issue. See #960 (b9a17d8)
  • explorer: dont focus first file when not searching (3fd437c)
  • explorer: dont process git when picker closed (c255d9c)
  • explorer: last status for indent guides taking hidden / ignored files into account (94bd2ef)
  • explorer: strip cwd from search text for explorer items (38f392a)
  • explorer: windows (b560054)
  • exporer.tree: and now hopefully on windows (ef9b12d)
  • gitbrowse: add support for GitHub Enterprise Cloud repo url (#1089) (97fd57e)
  • gitbrowse: cwd for permalinks (#1038) (0bf47dc)
  • gitbrowse: previous logic always overwrote 'commit' (#1127) (2f3f080)
  • git: use nul char as separator for git status (8e0dfd2)
  • health: skip dot dirs... Closes #1293 (aaed4a9)
  • image.doc: crop inline typst equations properly (#1320) (4f8b9eb)
  • image.doc: fixed at_cursor. Closes #1258 (76f5ee4)
  • image.health: add check for ghost-script to render pdfs. Closes #1248 (2b52d89)
  • image.health: allow convert if magick not available (4589e25)
  • image.hover: close when needed. Closes #1229 (1f9ba12)
  • image.latex: include doc packages for math rendering. Closes #1262 (2ee6488)
  • image.latex: inline math formulas. Closes #1246 (9e422e1)
  • image.markdown: fix image treesitter query. Closes #1300 (830ac62)
  • image.terminal: set passthrough=all instead of on for tmux. Closes #1249 (efcc25d)
  • image: added support for relative paths. Closes #1143 (2ef6375)
  • image: better cell size calculation for non-HDPI displays (e146a66)
  • image: better image position caluclation. Closes #1268 (5c0607e)
  • image: create cache dir (f8c4e03)
  • image: delay sending first image, to make ghostty happy. Closes #1333 (9aa8cbb)
  • image: delete terminal image on exit, just to be sure (317bfac)
  • image: do not attach to invalid buffers (#1238) (9a5e4de)
  • image: don't fallback to convert on windows, since that is a system tool (c1a1984)
  • image: failed state (5a37d83)
  • image: fix disappearing images when changing colorscheme (44e2f8e)
  • image: fixed gsub for angle brackets. Closes #1301 (beaa1c2)
  • image: fixup (de3cba5)
  • image: handle file uppercase file extensions. Closes #1202 (356f621)
  • image: handle inline images at the same TS node, but that changed url. See #1203 (86e3ddf)
  • image: hide progress when finished loading in for wezterm (526896a)
  • image: let text conversion continue on errors. See #1303 (6d1cda4)
  • image: mermaid theme. Closes #1282 (8117fb4)
  • image: move assertion for src/content. See #1276 (31e21cc)
  • image: only load image when the file exists. Closes #1143 (298499d)
  • image: only setup tmux pass-through on supported terminals. Fixes #1054 (78e692c)
  • image: prevent image id collisions by interleaving the nvim pid hash in the image id (31788ba)
  • image: relax check for wezterm. Closes #1076 (8d5ae25)
  • image: remove wezterm from supported terminals, since they don't support unicode placeholders. Closes #1063 (345260f)
  • image: remove debug (13863ea)
  • image: remove ft check, since we use lang already. Closes #1177 (4bcd26a)
  • image: remove some default latex packages (f45dd6c)
  • image: remove test (462578e)
  • image: return converted filename instead of original src. Closes #1213 (118eab0)
  • image: show full size when not showing image inline (d7c8fd9)
  • image: support Neovim < 0.10 (c067ffe)
  • image: wrong return when trying second command (74c4298)
  • input: add missing hl group for input title (#1164) (7014b91)
  • layout: deep merge instead of shallow merge for window options. Closes #1166 (27256cf)
  • layout: just hide any layouts below a backdrop. easier and looks better. (0dab071)
  • layout: make sure width/height are at least 1. Closes #1090 (c554097)
  • layout: take winbar into account for split layouts. Closes #996 (e4e5040)
  • layout: zindex weirdness on stable. Closes #1180 (72ffb3d)
  • notifier: keep notif when current buf is notif buf (a13c891)
  • picker.actions: better set cmdline. Closes #1291 (570c035)
  • picker.actions: check that plugin exists before loading it in help. Closes #1134 (e326de9)
  • picker.actions: don't delete empty buffer when its in another tabpage. Closes #1005 (1491b54)
  • picker.actions: don't reuse_win in floating windows (like the picker preview) (4b9ea98)
  • picker.actions: fix qflist position (#911) (6d3c135)
  • picker.actions: keymap confirm. Closes #1252 (a9a84dd)
  • picker.actions: reverse prev/next on select with a reversed list layout. Closes #1124 (eae55e7)
  • picker.actions: use vim.v.register instead of + as default. (9ab6637)
  • picker.buffers: remove dd to delete buffer from input keymaps. Closes #1193 (f311d1c)
  • picker.colorscheme: use wildignore. Closes #969 (ba8badf)
  • picker.config: use &lt;c-w&gt;HJKL to move float to far left/bottom/top/right. Only in normal mode. (34dd83c)
  • picker.explorer: ensure diagnostics can be disabled (#1145) (885c140)
  • picker.git: account for deleted files in git diff. Closes #1001 (e9e2e69)
  • picker.git: apply args to git, and not git grep. (2e284e2)
  • picker.git: better handling of multi file staging (b39a3ba)
  • picker.git: correct root dir for git log (c114a0d)
  • picker.git: formatting of git log (f320026)
  • picker.git: handle git status renames. Closes #1003 (93ad23a)
  • picker.git: preserve chronological order when matching (#1216) (8b19fd0)
  • picker.git: properly handle file renames for git log. Closes #1154 (9c436cb)
  • picker.help: make sure plugin is loaded for which we want to view the help (3841a87)
  • picker.highlight: lower case treesitter parser name (3367983)
  • picker.highlights: close on confirm. Closes #1096 (76f6e4f)
  • picker.input: prevent save dialog (fcb2f50)
  • picker.lines: use original buf instead of current (which can be the picker on refresh) (7ccf9c9)
  • picker.list: list:view should never transform reverse. Closes #1016 (be781f9)
  • picker.list: allow horizontal scrolling in the list (572436b)
  • picker.list: better wrap settings for when wrapping is enabled (a542ea4)
  • picker.list: correct offset calculation for large scrolloff. Closes #1208 (f4ca368)
  • picker.list: don't return non-matching items. Closes #1133 (d07e7ac)
  • picker.list: don't show preview when target cursor/top not yet reached. Closes #1204 (b02cb5e)
  • picker.list: dont transform with reverse for resolving target. Closes #1142 (0e36317)
  • picker.list: keep existing target if it exists unless force = true. Closes #1152 (121e74e)
  • picker.list: let user override wrap (22da4bd)
  • picker.list: reset preview when no results. Closes #1133 (f8bc119)
  • picker.lsp: fix indent guides for sorted document symbols (17360e4)
  • picker.lsp: handle invalid lsp kinds. Closes #1182 (f3cdd02)
  • picker.lsp: only sort when not getting workspace symbols. Closes #1071 (d607d2e)
  • picker.lsp: sort document symbols by position (cc22177)
  • picker.matcher: don't optimize pattern subsets when pattern has a negation (a6b3d78)
  • picker.matcher: only consider subset patterns that contain only whitespace and alpha numeric chars. Closes #1013 (fcf2311)
  • picker.notifications: close on confirm. Closes #1092 (a8dda99)
  • picker.preview: clear namespace on reset (a6d418e)
  • picker.preview: don't clear preview state on close so that colorscheme can be restored. Closes #932 (9688bd9)
  • picker.preview: don't reset preview when filtering and the same item is previewed (c8285c2)
  • picker.preview: fix newlines before setting lines of a buffer (62c2c62)
  • picker.preview: hide line numbers / status column for directory preview. Closes #1029 (f9aca86)
  • picker.preview: preview for uris. Closes #1075 (c1f93e2)
  • picker.preview: update titles on layout update. Closes #1113 (89b3ce1)
  • picker.preview: work-around for Neovim's messy window-local options (that are never truly local). Closes #1100 (e5960d8)
  • picker.proc: don't close stdout on proc exit, since it might still contain buffered output. Closes #966 (3b7021e)
  • picker.proc: make sure to emit the last line when done. Closes #1095 (b94926e)
  • picker.projects: add custom project dirs (c7293bd)
  • picker.projects: use fd or fdfind (270250c)
  • picker.watch: schedule_wrap. Closes #1049 (f489d61)
  • picker.zoxide: directory icon (#1031) (33dbebb)
  • picker: nil on :quit. Closes #1107 (1219f5e)
  • picker: opts.focus = false now works again (031f9e9)
  • picker: closed check for show preview. Closes #1181 (c1f4d30)
  • picker: consider zen windows as main. Closes #973 (b1db65a)
  • picker: disabled preview main (9fe43bd)
  • picker: don't render list when closed. See #1308 (681ae6e)
  • picker: exit insert mode before closing with &lt;c-c&gt; to prevent cursor shifting left. Close #956 (71eae96)
  • picker: go back to last window on cancel instead of main (4551f49)
  • picker: initial preview state when main (cd6e336)
  • picker: only show extmark errors when debug is enabled. Closes #988 (f6d9af7)
  • picker: remove debug (a23b10e)
  • picker: remove debug :) (3d53a73)
  • picker: save toggles for resume. Closes #1085 (e390713)
  • picker: sometimes main layout win gets selected. Closes #1015 (4799f82)
  • picker: update titles last on show. Closes #1113 (96796db)
  • picker: vim.ui.select callback is called when canceling selection (#1115) (4c3bfa2)
  • scroll: added keepjumps (7161dc1)
  • statuscolumn: only execute za when fold exists (#1093) (345eeb6)
  • terminal: check for 0.11 (6e45829)
  • terminal: softer check for using jobstart with term=true instead of deprecated termopen (544a2ae)
  • toggle: hide toggle when real keymap does not exist. Closes #378 (ee9e617)
  • win: apply win-local window options for new buffers displayed in a window. Fixes #925 (cb99c46)
  • win: better handling when the command window is open. Closes #1245 (7720410)
  • win: call on_close before actually closing so that prev win can be set. Closes #962 (a1cb54c)
  • words: default count to 1. Closes #1307 (45ec90b)
  • zen: properly get zoom options. Closes #1207 (3100333)

Performance Improvements

  • dashboard: speed up filtering for recent_files (#1250) (b91f417)
  • explorer: disable watchdirs fallback watcher (5d34380)
  • explorer: early exit for tree calculation (1a30610)
  • explorer: no need to get git status with -uall. Closes #983 (bc087d3)
  • explorer: only update tree if git status actually changed (5a2acf8)
  • explorer: only update tree when diagnostics actually changed (1142f46)
  • image.convert: identify during convert instead of calling identify afterwards (7b7f42f)
  • image: no need to run identify before convert for local files (e2d9941)
  • picker.list: only re-render when visible items changed (c72e62e)
  • picker: cache treesitter line highlights (af31c31)
  • picker: cache wether ts lang exists and disable smooth scrolling on big files (719b36f)
  • scroll: much better/easier/faster method for vertical cursor positioning (a3194d9)

Documentation

Don't miss a new snacks.nvim release

NewReleases is sending notifications on new releases.