---@module 'snacks' ---@module 'lazy' ---@type LazySpec return { { -- provides quality of life features for neovim 'folke/snacks.nvim', priority = 1000, lazy = false, ---@type snacks.Config opts = { animate = { enabled = false }, -- efficient animations including over 45 easing functions (library) bigfile = { enabled = false }, -- deal with big files bufdelete = { enabled = false }, -- delete buffers without disrupting window layout dashboard = { enabled = false }, -- beautiful declarative dashboards debug = { enabled = false }, -- pretty inspect & backtraces for debugging dim = { enabled = false }, -- focus on the active scope by dimming the rest explorer = { enabled = false }, -- a file explorer (picker in disguise) git = { enabled = false }, -- git utilities gitbrowse = { enabled = false }, -- open the current file, branch, commit, or repo in a browser (e.g. github, gitlab, etc.) image = { enabled = true }, -- image viewer using kitty graphics protocol indent = { enabled = false }, -- indent guides and scopes input = { enabled = false }, -- better vim.ui.input layout = { enabled = false }, -- window layouts lazygit = { enabled = false }, -- open lazygit in a float, auto-configure colour scheme and integration with neovim notifier = { enabled = true }, -- pretty vim.notify notify = { enabled = true }, -- utility functions to work with neovim's vim.notify picker = { enabled = false }, -- picker for selecting items profiler = { enabled = false }, -- neovim lua profiler quickfile = { enabled = true }, -- when doing nvim somefile.txt, it will render the file as quickly as possible, before loading your plugins. rename = { enabled = true }, -- LSP-integrated file renaming with support for plugins like and. scope = { enabled = false }, -- scope detection, text objects and jumping based on treesitter or indent scratch = { enabled = false }, -- scratch buffers with a persistent file scroll = { enabled = false }, -- smooth scrolling statuscolumn = { enabled = false }, -- pretty status column terminal = { enabled = false }, -- create and toggle floating/split terminals toggle = { enabled = false }, -- toggle keymaps integrated with which-key icons / colours util = { enabled = false }, -- utility functions for Snacks (library) win = { enabled = false }, -- create and manage floating windows or splits words = { enabled = true }, -- auto-show LSP references and quickly navigate between them zen = { enabled = false }, -- zen mode; distraction-free coding }, keys = { { '*', function() Snacks.words.jump(-vim.v.count1) end, desc = 'next reference', nowait = true }, { '#', function() Snacks.words.jump(vim.v.count1) end, desc = 'prev reference', nowait = true }, { '', function() Snacks.bufdelete() end, desc = 'delete buffer', nowait = true }, { 'N', function() Snacks.notifier.show_history() end, desc = 'show notification history' }, { 'U', function() Snacks.picker.undo() end, desc = 'undo tree' }, { 'gB', function() Snacks.git.blame_line() end, desc = 'git blame line' }, { 'gb', function() Snacks.picker.git_branches() end, desc = 'git branches' }, { '@', function() Snacks.picker.lsp_symbols() end, desc = 'workspace symbols' }, { 'ld', function() Snacks.picker.lsp_definitions() end, desc = 'definition' }, { 'lr', function() Snacks.picker.lsp_references() end, desc = 'references' }, { 'li', function() Snacks.picker.lsp_implementations() end, desc = 'implementation' }, { 'lt', function() Snacks.picker.lsp_type_definitions() end, desc = 'type definition' }, { '?', function() Snacks.picker.keymaps() end, desc = 'keymaps' }, { 'gd', function() Snacks.picker.lsp_definitions() end, desc = 'definition' }, { 'gr', function() Snacks.picker.lsp_references() end, desc = 'references' }, }, init = function() Autocmd("User", { pattern = 'VeryLazy', callback = function() local virt_lines = false; Snacks.toggle.new({ id = "virtual_lines", name = "diagnostics virtual lines", get = function() return virt_lines end, set = function(v) virt_lines = v vim.diagnostic.config({ virtual_lines = v }) end, }):map('tl') Snacks.toggle.option('wrap', { name = 'word wrap' }):map('tw') Snacks.toggle.option('spell', { name = 'spelling' }):map('ts') Snacks.toggle.inlay_hints():map('th') end, }) end, ---@param opts snacks.Config config = function(_, opts) require('snacks').setup(opts) end } }