Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: folke/snacks.nvim
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.6.0
Choose a base ref
...
head repository: folke/snacks.nvim
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.7.0
Choose a head ref

Commits on Nov 30, 2024

  1. Copy the full SHA
    8e6d977 View commit details
  2. Copy the full SHA
    b813c33 View commit details
  3. Copy the full SHA
    d517b11 View commit details

Commits on Dec 1, 2024

  1. Copy the full SHA
    7c29848 View commit details
  2. Copy the full SHA
    e6f6397 View commit details
  3. Copy the full SHA
    1cec695 View commit details
  4. docs: docgen

    folke committed Dec 1, 2024
    Copy the full SHA
    c7802cc View commit details
  5. Copy the full SHA
    2080d41 View commit details
  6. Copy the full SHA
    462e92d View commit details
  7. Copy the full SHA
    a68fad8 View commit details
  8. Copy the full SHA
    0c63ba6 View commit details
  9. Copy the full SHA
    cb79551 View commit details
  10. Copy the full SHA
    5a50738 View commit details
  11. docs: scratch

    folke authored Dec 1, 2024
    Copy the full SHA
    353f069 View commit details
  12. feat(debug): added Snacks.debug.run() to execute the buffer or sele…

    …ction with inlined print and errors
    folke committed Dec 1, 2024
    Copy the full SHA
    e1fe4f5 View commit details
  13. Copy the full SHA
    7db0ed4 View commit details
  14. Copy the full SHA
    32c46b4 View commit details
  15. docs(scratch): docgen

    folke committed Dec 1, 2024
    Copy the full SHA
    8f6719a View commit details
  16. Copy the full SHA
    8088799 View commit details
  17. Copy the full SHA
    999ae07 View commit details
  18. docs: docgen

    folke committed Dec 1, 2024
    Copy the full SHA
    7e9fdd4 View commit details
  19. docs: added profiler to readme

    folke committed Dec 1, 2024
    Copy the full SHA
    0b6be55 View commit details
  20. Copy the full SHA
    3b75f0f View commit details
  21. Copy the full SHA
    f68768f View commit details
  22. Copy the full SHA
    293bc4a View commit details
  23. docs(profiler): screenshot

    folke authored Dec 1, 2024
    Copy the full SHA
    d023bf7 View commit details
  24. Copy the full SHA
    0043fa9 View commit details
  25. Copy the full SHA
    7a47eb7 View commit details
  26. Copy the full SHA
    90cfaa2 View commit details
  27. Copy the full SHA
    ca7188c View commit details
  28. Copy the full SHA
    ddaa2aa View commit details
  29. feat(gitbrowse): allow custom branch (#172)

    ## Description
    Allow the user to be able to define custom branch with
    `Snacks.gitbrowse`. I also added `start_line` and `end_line` (default to
    `nil`), because from my testing when using a keymap such as the one in
    [my comment in the related
    issue](#170 (comment))
    or this one which I came up later while implementing this
    ```lua
    vim.keymap.set({ "n", "x" }, "<leader>gY", function()
      local function system(cmd, err)
        local proc = vim.fn.system(cmd)
        if vim.v.shell_error ~= 0 then
          Snacks.notify.error({ err, proc }, { title = "Git Browse" })
          error(err)
        end
        return vim.split(vim.trim(proc), "\n")
      end
      local branches = {}
      local start_line, end_line
      if vim.fn.mode() == "v" or vim.fn.mode() == "V" then
        start_line = vim.fn.line("v")
        end_line = vim.fn.line(".")
        if start_line > end_line then
          start_line, end_line = end_line, start_line
        end
      end
      for _, branch in ipairs(system({ "git", "branch" }, "Failed to get git branches")) do
        branch = branch:match("%s*[%*]?%s*(%S+)")
        table.insert(branches, branch)
      end
      vim.ui.select(branches, {
        prompt = "Select branch",
      }, function(choice)
        if choice then
          Snacks.gitbrowse({ start_line = start_line or nil, end_line = end_line or nil, branch = choice })
        end
      end)
    end, { desc = "Git Browse ()" })
    ```
    Then the visual lines would not work. My guess is that in the first case
    the command line prompt and in the second case the `vim.ui.select`
    before calling `Snacks.gitbrowse` break the Visual mode state and any
    visual selection is not propagated to `Snacks.gitbrowse` to be properly
    evaluated by the internal code for visual lines selection, which works
    just fine when you just call directly `Snacks.gitbrowse()` via a
    function in a keymap (which I assume doesn't break Visual mode state).
    That's why I had to implement the visual selection again in the keymap
    as well and needed the extra parameters to pass the newly evaluated
    values.
    
    Please do correct me if I'm somehow wrong in my logical deduction (which
    is based mostly on observation and guessing) and maybe `start_line` and
    `end_line` are not needed. Except if the user passes the option directly
    in the keymap, but then he would have to create multiple keymaps for
    different branches, which in my personal opinion defeats the purpose of
    this feature.
    
    In both cases of the keymaps I mentioned the user can dynamically either
    type or choose the branch available to him. But maybe I'm missing
    something in both the keymaps implementations that I came up with.
    <!-- Describe the big picture of your changes to communicate to the
    maintainers
      why we should accept this pull request. -->
    
    ## Related Issue(s)
    Closes #170.
    <!--
      If this PR fixes any issues, please link to the issue here.
      - Fixes #<issue_number>
    -->
    
    ## Screenshots
    
    <!-- Add screenshots of the changes if applicable. -->
    
    ---------
    
    Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
    dpetka2001 and folke authored Dec 1, 2024
    Copy the full SHA
    e5bc11e View commit details
  30. Copy the full SHA
    9ef424b View commit details
  31. Copy the full SHA
    93b254d View commit details
  32. fix(profiler): startup opts

    folke committed Dec 1, 2024
    Copy the full SHA
    85f5132 View commit details
  33. Copy the full SHA
    891648a View commit details
  34. Copy the full SHA
    b99bc64 View commit details
  35. Copy the full SHA
    f4e3198 View commit details
  36. Copy the full SHA
    4bdf7da View commit details
  37. Copy the full SHA
    4f90e63 View commit details
  38. Copy the full SHA
    6db50cf View commit details
  39. Copy the full SHA
    5f768f8 View commit details
  40. Copy the full SHA
    d370be6 View commit details
  41. docs: docgen

    folke committed Dec 1, 2024
    Copy the full SHA
    30ae618 View commit details
  42. docs: added a setup section to docgen, since some people didn't know …

    …how to configure snacks...
    folke committed Dec 1, 2024
    Copy the full SHA
    67894ee View commit details

Commits on Dec 2, 2024

  1. Copy the full SHA
    adf0433 View commit details
  2. Copy the full SHA
    0ea57a2 View commit details
  3. Copy the full SHA
    f03727c View commit details
  4. Copy the full SHA
    0a48c2e View commit details
  5. fix(gitbrowse): removed debug

    folke committed Dec 2, 2024
    Copy the full SHA
    f894952 View commit details
Showing with 4,610 additions and 280 deletions.
  1. +62 −0 CHANGELOG.md
  2. +11 −4 README.md
  3. +23 −2 doc/snacks-bigfile.txt
  4. +74 −13 doc/snacks-dashboard.txt
  5. +15 −1 doc/snacks-debug.txt
  6. +48 −8 doc/snacks-gitbrowse.txt
  7. +27 −6 doc/snacks-init.txt
  8. +29 −10 doc/snacks-lazygit.txt
  9. +30 −11 doc/snacks-notifier.txt
  10. +516 −0 doc/snacks-profiler.txt
  11. +21 −2 doc/snacks-quickfile.txt
  12. +204 −0 doc/snacks-scratch.txt
  13. +23 −4 doc/snacks-statuscolumn.txt
  14. +29 −10 doc/snacks-terminal.txt
  15. +43 −8 doc/snacks-toggle.txt
  16. +52 −0 doc/snacks-util.txt
  17. +42 −13 doc/snacks-win.txt
  18. +23 −4 doc/snacks-words.txt
  19. +19 −7 doc/snacks.nvim.txt
  20. +18 −0 docs/bigfile.md
  21. +57 −1 docs/dashboard.md
  22. +14 −1 docs/debug.md
  23. +23 −1 docs/examples/dashboard.lua
  24. +7 −4 docs/examples/init.lua
  25. +38 −4 docs/gitbrowse.md
  26. +17 −0 docs/init.md
  27. +20 −1 docs/lazygit.md
  28. +17 −1 docs/notifier.md
  29. +449 −0 docs/profiler.md
  30. +16 −0 docs/quickfile.md
  31. +168 −0 docs/scratch.md
  32. +16 −0 docs/statuscolumn.md
  33. +16 −0 docs/terminal.md
  34. +28 −0 docs/toggle.md
  35. +42 −0 docs/util.md
  36. +29 −3 docs/win.md
  37. +16 −0 docs/words.md
  38. +2 −0 lua/snacks/bigfile.lua
  39. +115 −34 lua/snacks/dashboard.lua
  40. +123 −4 lua/snacks/debug.lua
  41. +17 −0 lua/snacks/docs.lua
  42. +54 −22 lua/snacks/gitbrowse.lua
  43. +1 −0 lua/snacks/init.lua
  44. +4 −1 lua/snacks/lazygit.lua
  45. +5 −1 lua/snacks/notifier.lua
  46. +236 −0 lua/snacks/profiler/core.lua
  47. +383 −0 lua/snacks/profiler/init.lua
  48. +139 −0 lua/snacks/profiler/loc.lua
  49. +178 −0 lua/snacks/profiler/picker.lua
  50. +228 −0 lua/snacks/profiler/tracer.lua
  51. +249 −0 lua/snacks/profiler/ui.lua
  52. +270 −0 lua/snacks/scratch.lua
  53. +36 −47 lua/snacks/statuscolumn.lua
  54. +32 −0 lua/snacks/toggle.lua
  55. +72 −0 lua/snacks/util.lua
  56. +106 −52 lua/snacks/win.lua
  57. +78 −0 lua/trouble/sources/profiler.lua
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,67 @@
# Changelog

## [2.7.0](https://github.com/folke/snacks.nvim/compare/v2.6.0...v2.7.0) (2024-12-07)


### Features

* **bigfile:** disable matchparen, set foldmethod=manual, set conceallevel=0 ([891648a](https://github.com/folke/snacks.nvim/commit/891648a483b6f5410ec9c8b74890d5a00b50fa4c))
* **dashbard:** explude files from stdpath data/cache/state in recent files and projects ([b99bc64](https://github.com/folke/snacks.nvim/commit/b99bc64ef910cd075e4ab9cf0914e99e1a1d61c1))
* **dashboard:** allow items to be hidden, but still create the keymaps etc ([7a47eb7](https://github.com/folke/snacks.nvim/commit/7a47eb76df2fd36bfcf3ed5c4da871542e1386be))
* **dashboard:** allow terminal sections to have actions. Closes [#189](https://github.com/folke/snacks.nvim/issues/189) ([78f44f7](https://github.com/folke/snacks.nvim/commit/78f44f720b1b0609930581965f4f92649efae95b))
* **dashboard:** hide title if section has no items. Fixes [#184](https://github.com/folke/snacks.nvim/issues/184) ([d370be6](https://github.com/folke/snacks.nvim/commit/d370be6d6966a298725901abad4bec90264859af))
* **dashboard:** make buffer not listed ([#191](https://github.com/folke/snacks.nvim/issues/191)) ([42d6277](https://github.com/folke/snacks.nvim/commit/42d62775d82b7af4dbe001b04be6a8a6e461e8ec))
* **dashboard:** when a section has a title, use that for action and key. If not put it in the section. Fixes [#189](https://github.com/folke/snacks.nvim/issues/189) ([045a17d](https://github.com/folke/snacks.nvim/commit/045a17da069aae6221b2b3eae8610c2aa5ca03ea))
* **debug:** added `Snacks.debug.run()` to execute the buffer or selection with inlined print and errors ([e1fe4f5](https://github.com/folke/snacks.nvim/commit/e1fe4f5afed5c679fd2eed3486f17e8c0994b982))
* **gitbrowse:** added `line_count`. See [#186](https://github.com/folke/snacks.nvim/issues/186) ([f03727c](https://github.com/folke/snacks.nvim/commit/f03727c77f739503fd297dd12a826c2aca3490f9))
* **gitbrowse:** opts.notify ([a856952](https://github.com/folke/snacks.nvim/commit/a856952ab24757f4eaf4ae2e1728d097f1866681))
* **gitbrowse:** url pattern can now also be a function ([0a48c2e](https://github.com/folke/snacks.nvim/commit/0a48c2e726e6ca90370260a05618f45345dbb66a))
* **notifier:** reverse notif history by default for `show_history` ([5a50738](https://github.com/folke/snacks.nvim/commit/5a50738b8e952519658570f31ff5f24e06882f18))
* **scratch:** `opts.ft` can now be a function and defaults to the ft of the current buffer or markdown ([652303e](https://github.com/folke/snacks.nvim/commit/652303e6de5fa746709979425f4bed763e3fcbfa))
* **scratch:** change keymap to execute buffer/selection to `&lt;cr&gt;` ([7db0ed4](https://github.com/folke/snacks.nvim/commit/7db0ed4239a2f67c0ca288aaac21bc6aa65212a7))
* **scratch:** use `Snacks.debug.run()` to execute buffer/selection ([32c46b4](https://github.com/folke/snacks.nvim/commit/32c46b4e2f61c026e41b3fa128d01b0e89da106c))
* **snacks:** added `Snacks.profiler` ([8088799](https://github.com/folke/snacks.nvim/commit/808879951f960399844c89efef9aec1724f83402))
* **snacks:** added new `scratch` snack ([1cec695](https://github.com/folke/snacks.nvim/commit/1cec695fefb6e42ee644cfaf282612c213009aed))
* **toggle:** toggles for the profiler ([999ae07](https://github.com/folke/snacks.nvim/commit/999ae07808858df08d30eb099a8dbce401527008))
* **util:** encode/decode a string to be used as a filename ([e6f6397](https://github.com/folke/snacks.nvim/commit/e6f63970de2225ad44ed08af7ffd8a0f37d8fc58))
* **util:** simple function to get an icon ([7c29848](https://github.com/folke/snacks.nvim/commit/7c29848e89861b40e751cc15c557cf1e574acf66))
* **win:** added `opts.fixbuf` to configure fixed window buffers ([1f74d1c](https://github.com/folke/snacks.nvim/commit/1f74d1ce77d2015e2802027c93b9e0bcd548e4d1))
* **win:** backdrop can now be made opaque ([681b9c9](https://github.com/folke/snacks.nvim/commit/681b9c9d650e7b01a5e54567656f646fbd3b8d46))
* **win:** width/height can now be a function ([964d7ae](https://github.com/folke/snacks.nvim/commit/964d7ae99af1f45949175e1494562a796e2ef99b))


### Bug Fixes

* **dashboard:** calculate proper offset when item has no text ([6e3b954](https://github.com/folke/snacks.nvim/commit/6e3b9546de4871a696652cfcee6768c39e7b8ee9))
* **dashboard:** prevent possible duplicate recent files. Fixes [#171](https://github.com/folke/snacks.nvim/issues/171) ([93b254d](https://github.com/folke/snacks.nvim/commit/93b254d65845aa44ad1e01000c26e1faf5efb9a6))
* **dashboard:** take hidden items into account when calculating padding. Fixes [#194](https://github.com/folke/snacks.nvim/issues/194) ([736ce44](https://github.com/folke/snacks.nvim/commit/736ce447e8815eb231271abf7d49d8fa7d96e225))
* **dashboard:** take indent into account when calculating terminal width ([cda695e](https://github.com/folke/snacks.nvim/commit/cda695e53ffb34c7569dc3536134c9e432b2a1c1))
* **dashboard:** truncate file names when too long. Fixes [#183](https://github.com/folke/snacks.nvim/issues/183) ([4bdf7da](https://github.com/folke/snacks.nvim/commit/4bdf7daece384ab8a5472e6effd5fd6167a5ce6a))
* **debug:** better way of getting visual selection. See [#190](https://github.com/folke/snacks.nvim/issues/190) ([af41cb0](https://github.com/folke/snacks.nvim/commit/af41cb088d3ff8da9dede9fbdd5c81860bc37e64))
* **gitbrowse:** opts.notify ([2436557](https://github.com/folke/snacks.nvim/commit/243655796e4adddf58ce581f1b86a283130ecf41))
* **gitbrowse:** removed debug ([f894952](https://github.com/folke/snacks.nvim/commit/f8949523ed3f27f976e5346051a6658957d9492a))
* **gitbrowse:** use line_start and line_end directly in patterns. Closes [#186](https://github.com/folke/snacks.nvim/issues/186) ([adf0433](https://github.com/folke/snacks.nvim/commit/adf0433e8fca3fbc7287ac7b05f01f10ac354283))
* **profiler:** startup opts ([85f5132](https://github.com/folke/snacks.nvim/commit/85f51320b2662830a6435563668a04ab21686178))
* **scratch:** always set filetype on the buffer. Fixes [#179](https://github.com/folke/snacks.nvim/issues/179) ([6db50cf](https://github.com/folke/snacks.nvim/commit/6db50cfe2d1b333512e8175d072a2f82e796433d))
* **scratch:** floating window title/footer hl groups ([6c25ab1](https://github.com/folke/snacks.nvim/commit/6c25ab1108d12ef3642e97e3757710e69782cbd1))
* **scratch:** make sure win.opts.keys exists. See [#190](https://github.com/folke/snacks.nvim/issues/190) ([50bd510](https://github.com/folke/snacks.nvim/commit/50bd5103ba0a15294b1a931fda14900e7fd10161))
* **scratch:** sort keys. Fixes [#193](https://github.com/folke/snacks.nvim/issues/193) ([0df7a08](https://github.com/folke/snacks.nvim/commit/0df7a08b01b037e434efe7cd25e7d4608a282a92))
* **scratch:** weirdness with visual selection and inclusive/exclusive. See [#190](https://github.com/folke/snacks.nvim/issues/190) ([f955f08](https://github.com/folke/snacks.nvim/commit/f955f082e09683d02df3fd0f8b621b938f38e6aa))
* **statuscolumn:** add virtnum and relnum to cache key. See [#198](https://github.com/folke/snacks.nvim/issues/198) ([3647ca7](https://github.com/folke/snacks.nvim/commit/3647ca7d8a47362a01b539f5b6efc2d5339b5e8e))
* **statuscolumn:** don't show signs on virtual ligns. See [#198](https://github.com/folke/snacks.nvim/issues/198) ([f5fb59c](https://github.com/folke/snacks.nvim/commit/f5fb59cc4c62e25745bbefd2ef55665a67196245))
* **util:** better support for nvim-web-devicons ([ddaa2aa](https://github.com/folke/snacks.nvim/commit/ddaa2aaba59bbd05c03992bfb295c98ccd3b3e50))
* **util:** make sure to always return an icon ([ca7188c](https://github.com/folke/snacks.nvim/commit/ca7188c531350fe313c211ad60a59d642749f93e))
* **win:** allow resolving nil window option values. Fixes [#179](https://github.com/folke/snacks.nvim/issues/179) ([0043fa9](https://github.com/folke/snacks.nvim/commit/0043fa9ee142b63ab653507f2e6f45395e8a23d5))
* **win:** don't force close modified buffers ([d517b11](https://github.com/folke/snacks.nvim/commit/d517b11cabf94bf833d020c7a0781122d0f48c06))
* **win:** update opts.wo for padding instead of vim.wo directly ([446f502](https://github.com/folke/snacks.nvim/commit/446f50208fe823787ce60a8b216a622a4b6b63dd))
* **win:** update window local options when the buffer changes ([630d96c](https://github.com/folke/snacks.nvim/commit/630d96cf1f0403352580f2d119fc3b3ba29e33a4))


### Performance Improvements

* **dashboard:** properly cleanup autocmds ([8e6d977](https://github.com/folke/snacks.nvim/commit/8e6d977ec985a1b3f12a53741df82881a7835f9a))
* **statuscolumn:** optimize caching ([d972bc0](https://github.com/folke/snacks.nvim/commit/d972bc0a471fbf3067a115924a4add852d15f5f0))

## [2.6.0](https://github.com/folke/snacks.nvim/compare/v2.5.0...v2.6.0) (2024-11-29)


15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -15,8 +15,10 @@ A collection of small QoL plugins for Neovim.
| [lazygit](https://github.com/folke/snacks.nvim/blob/main/docs/lazygit.md) | Open LazyGit in a float, auto-configure colorscheme and integration with Neovim | |
| [notify](https://github.com/folke/snacks.nvim/blob/main/docs/notify.md) | Utility functions to work with Neovim's `vim.notify` | |
| [notifier](https://github.com/folke/snacks.nvim/blob/main/docs/notifier.md) | Better and prettier `vim.notify` | ‼️ |
| [profiler](https://github.com/folke/snacks.nvim/blob/main/docs/profiler.md) | Neovim Lua profiler | |
| [quickfile](https://github.com/folke/snacks.nvim/blob/main/docs/quickfile.md) | When doing `nvim somefile.txt`, it will render the file as quickly as possible, before loading your plugins. | ‼️ |
| [rename](https://github.com/folke/snacks.nvim/blob/main/docs/rename.md) | LSP-integrated file renaming with support for plugins like [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) and [mini.files](https://github.com/echasnovski/mini.files). | |
| [scratch](https://github.com/folke/snacks.nvim/blob/main/docs/scratch.md) | Scratch buffers | |
| [statuscolumn](https://github.com/folke/snacks.nvim/blob/main/docs/statuscolumn.md) | Pretty statuscolumn | ‼️ |
| [terminal](https://github.com/folke/snacks.nvim/blob/main/docs/terminal.md) | Create and toggle floating/split terminals | |
| [toggle](https://github.com/folke/snacks.nvim/blob/main/docs/toggle.md) | Toggle keymaps integrated with which-key icons / colors | |
@@ -156,14 +158,17 @@ See the example below for how to configure `snacks.nvim`.
}
},
keys = {
{ "<leader>un", function() Snacks.notifier.hide() end, desc = "Dismiss All Notifications" },
{ "<leader>.", function() Snacks.scratch() end, desc = "Toggle Scratch Buffer" },
{ "<leader>S", function() Snacks.scratch.select() end, desc = "Select Scratch Buffer" },
{ "<leader>n", function() Snacks.notifier.show_history() end, desc = "Notification History" },
{ "<leader>bd", function() Snacks.bufdelete() end, desc = "Delete Buffer" },
{ "<leader>gg", function() Snacks.lazygit() end, desc = "Lazygit" },
{ "<leader>gb", function() Snacks.git.blame_line() end, desc = "Git Blame Line" },
{ "<leader>cR", function() Snacks.rename.rename_file() end, desc = "Rename File" },
{ "<leader>gB", function() Snacks.gitbrowse() end, desc = "Git Browse" },
{ "<leader>gb", function() Snacks.git.blame_line() end, desc = "Git Blame Line" },
{ "<leader>gf", function() Snacks.lazygit.log_file() end, desc = "Lazygit Current File History" },
{ "<leader>gg", function() Snacks.lazygit() end, desc = "Lazygit" },
{ "<leader>gl", function() Snacks.lazygit.log() end, desc = "Lazygit Log (cwd)" },
{ "<leader>cR", function() Snacks.rename.rename_file() end, desc = "Rename File" },
{ "<leader>un", function() Snacks.notifier.hide() end, desc = "Dismiss All Notifications" },
{ "<c-/>", function() Snacks.terminal() end, desc = "Toggle Terminal" },
{ "<c-_>", function() Snacks.terminal() end, desc = "which_key_ignore" },
{ "]]", function() Snacks.words.jump(vim.v.count1) end, desc = "Next Reference", mode = { "n", "t" } },
@@ -232,6 +237,8 @@ See the example below for how to configure `snacks.nvim`.
| **SnacksBackdrop** | _none_ | Backdrop |
| **SnacksNormalNC** | _NormalFloat_ | Normal for non-current windows |
| **SnacksWinBarNC** | _SnacksWinBar_ | Title for non-current windows |
| **SnacksScratchKey** | _DiagnosticVirtualText_ | Keymap help in the footer |
| **SnacksScratchDesc** | _DiagnosticInfo_ | Keymap help desc in the footer |
| **SnacksNotifierInfo** | _none_ | Notification window for Info |
| **SnacksNotifierWarn** | _none_ | Notification window for Warn |
| **SnacksNotifierDebug** | _none_ | Notification window for Debug |
25 changes: 23 additions & 2 deletions doc/snacks-bigfile.txt
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@
==============================================================================
Table of Contents *snacks-bigfile-table-of-contents*

1. Config |snacks-bigfile-config|
1. Setup |snacks-bigfile-setup|
2. Config |snacks-bigfile-config|
`bigfile` adds a new filetype `bigfile` to Neovim that triggers when the file
is larger than the configured size. This automatically prevents things like LSP
and Treesitter attaching to the buffer.
@@ -16,7 +17,25 @@ mini.animate <https://github.com/echasnovski/mini.animate> (if used)


==============================================================================
1. Config *snacks-bigfile-config*
1. Setup *snacks-bigfile-setup*

>lua
-- lazy.nvim
{
"folke/snacks.nvim",
opts = {
bigfile = {
-- your bigfile configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
}
}
<


==============================================================================
2. Config *snacks-bigfile-config*

>lua
---@class snacks.bigfile.Config
@@ -26,6 +45,8 @@ mini.animate <https://github.com/echasnovski/mini.animate> (if used)
-- Enable or disable features when big file detected
---@param ctx {buf: number, ft:string}
setup = function(ctx)
vim.cmd([[NoMatchParen]])
Snacks.util.wo(0, { foldmethod = "manual", statuscolumn = "", conceallevel = 0 })
vim.b.minianimate_disable = true
vim.schedule(function()
vim.bo[ctx.buf].syntax = ctx.ft
Loading