Skip to content

[audit] snacks.nvim bigfile/gitbrowse modules installed but unconfigured #209

Closed

Description

@stanfish06

What

snacks.nvim is installed (lua/config/plugins.lua:35) and snacks.setup() (lua/config/plugin_config.lua:341-363) only enables scroll, indent, and notifier. Two bundled modules that fit the existing config are left off:

  • bigfile — auto-disables treesitter/LSP/syntax for very large files.
  • gitbrowse — opens the current line/selection at its GitHub/GitLab permalink.

Where

lua/config/plugin_config.lua:341-363 (snacks setup).

Why it matters

  • The config runs a custom per-buffer treesitter-start autocmd on every FileType event with no file-size guard (lua/config/treesitter.lua:186-198), and vim.o.foldmethod = "expr" with foldexpr = v:lua.vim.treesitter.foldexpr() (lua/config/options.lua:110-111) also runs treesitter on every buffer. Opening a multi-MB file (log dump, vendored JS bundle, generated SQL, etc.) has no safety net and can hang the UI parsing/folding it. snacks.bigfile exists specifically to detect this and skip treesitter/LSP/folding for oversized buffers — zero-cost when not triggered.
  • The git stack already includes fugitive.vim, gitsigns.nvim, and diffview.nvim, but there's no quick way to generate a shareable permalink to the current line — snacks.gitbrowse fills that gap using a plugin that's already a dependency, no new install needed.

Recommended action

Enable both modules in the existing snacks.setup() call, e.g.:

snacks.setup({
    bigfile = { enabled = true },
    gitbrowse = { enabled = true },
    -- ...existing scroll/indent/notifier...
})

Bind a keymap for gitbrowse (e.g. <leader>go) similar to the existing <leader>gd/<leader>gh diffview binds. Tune bigfile's size threshold to taste (default is 1.5MB).

Activity

  1. stanfish06 commented on Jul 26, 2026

    @stanfish06
    OwnerAuthor

    Half fixed in 3cfb0cf.

    bigfile — enabled. This was the part with real consequences: treesitter.lua starts treesitter on every FileType with no size guard, and options.lua sets foldexpr = v:lua.vim.treesitter.foldexpr() globally, so a multi-MB buffer had nothing standing between it and a parse/fold hang. Verified snacks.config.bigfile resolves to { enabled = true } at runtime.

    gitbrowse — deliberately skipped. Enabling the module alone does nothing without a keymap or command to invoke it, and adding one was outside what was asked for here. Worth a separate issue if you want line permalinks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions