-- You can add your own plugins here or in other files in this directory! -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information return { { 'folke/snacks.nvim', priority = 1000, lazy = false, ---@type snacks.Config opts = { bigfile = { enabled = true }, dashboard = { enabled = true }, notifier = { enabled = true, timeout = 3000, }, quickfile = { enabled = true }, statuscolumn = { enabled = true }, words = { enabled = true }, styles = { notification = { wo = { wrap = true }, -- Wrap notifications }, }, }, keys = { { 'un', function() Snacks.notifier.hide() end, desc = 'Dismiss All Notifications', }, { 'bd', function() Snacks.bufdelete() end, desc = 'Delete Buffer', }, { 'gg', function() Snacks.lazygit() end, desc = 'Lazygit', }, { 'gb', function() Snacks.git.blame_line() end, desc = 'Git Blame Line', }, { 'gB', function() Snacks.gitbrowse() end, desc = 'Git Browse', }, { 'gf', function() Snacks.lazygit.log_file() end, desc = 'Lazygit Current File History', }, { 'gl', function() Snacks.lazygit.log() end, desc = 'Lazygit Log (cwd)', }, { 'cR', function() Snacks.rename.rename_file() end, desc = 'Rename File', }, { '', function() Snacks.terminal() end, desc = 'Toggle Terminal', }, { '', function() Snacks.terminal() end, desc = 'which_key_ignore', }, { ']]', function() Snacks.words.jump(vim.v.count1) end, desc = 'Next Reference', mode = { 'n', 't' }, }, { '[[', function() Snacks.words.jump(-vim.v.count1) end, desc = 'Prev Reference', mode = { 'n', 't' }, }, }, init = function() vim.api.nvim_create_autocmd('User', { pattern = 'VeryLazy', callback = function() -- Setup some globals for debugging (lazy-loaded) _G.dd = function(...) Snacks.debug.inspect(...) end _G.bt = function() Snacks.debug.backtrace() end vim.print = _G.dd -- Override print to use snacks for `:=` command -- Create some toggle mappings Snacks.toggle.option('spell', { name = 'Spelling' }):map 'us' Snacks.toggle.option('wrap', { name = 'Wrap' }):map 'uw' Snacks.toggle.option('relativenumber', { name = 'Relative Number' }):map 'uL' Snacks.toggle.diagnostics():map 'ud' Snacks.toggle.line_number():map 'ul' Snacks.toggle.option('conceallevel', { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }):map 'uc' Snacks.toggle.treesitter():map 'uT' Snacks.toggle.option('background', { off = 'light', on = 'dark', name = 'Dark Background' }):map 'ub' Snacks.toggle.inlay_hints():map 'uh' end, }) end, }, { 'MeanderingProgrammer/render-markdown.nvim', dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons ---@module 'render-markdown' ---@type render.md.UserConfig opts = {}, }, { 'yetone/avante.nvim', event = 'VeryLazy', lazy = false, version = false, -- set this if you want to always pull the latest change opts = { -- add any opts here }, -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` build = 'make', -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows dependencies = { 'stevearc/dressing.nvim', 'nvim-lua/plenary.nvim', 'MunifTanjim/nui.nvim', --- The below dependencies are optional, 'hrsh7th/nvim-cmp', -- autocompletion for avante commands and mentions 'nvim-tree/nvim-web-devicons', -- or echasnovski/mini.icons 'zbirenbaum/copilot.lua', -- for providers='copilot' { -- support for image pasting 'HakonHarnes/img-clip.nvim', event = 'VeryLazy', opts = { -- recommended settings default = { embed_image_as_base64 = false, prompt_for_file_name = false, drag_and_drop = { insert_mode = true, }, -- required for Windows users use_absolute_path = true, }, }, }, { -- Make sure to set this up properly if you have lazy=true 'MeanderingProgrammer/render-markdown.nvim', opts = { file_types = { 'markdown', 'Avante' }, }, ft = { 'markdown', 'Avante' }, }, }, config = function() require('avante').setup { provider = 'openai', auto_suggestions_provider = 'openai', behaviour = { auto_suggestions = true, -- experimental stage auto_set_highlight_group = true, auto_set_keymaps = true, auto_apply_diff_after_generation = false, support_paste_from_clipboard = true, minimize_diff = true, -- whether to remove unchanged lines when applying a code block }, } end, }, { 'jose-elias-alvarez/null-ls.nvim', config = function() local null_ls = require 'null-ls' local root_has_file = function(files) return function(utils) return utils.root_has_file(files) end end local eslint_root_files = { '.eslintrc', '.eslintrc.js', '.eslintrc.json' } local prettier_root_files = { '.prettierrc', '.prettierrc.js', '.prettierrc.json' } local stylua_root_files = { 'stylua.toml', '.stylua.toml' } local elm_root_files = { 'elm.json' } local opts = { eslint_formatting = { condition = function(utils) local has_eslint = root_has_file(eslint_root_files)(utils) local has_prettier = root_has_file(prettier_root_files)(utils) return has_eslint and not has_prettier end, }, eslint_diagnostics = { condition = root_has_file(eslint_root_files), }, prettier_formatting = { condition = root_has_file(prettier_root_files), }, stylua_formatting = { condition = root_has_file(stylua_root_files), }, elm_format_formatting = { condition = root_has_file(elm_root_files), }, } local function on_attach(client, _) if client.server_capabilities.document_formatting then vim.cmd 'command! -buffer Formatting lua vim.lsp.buf.formatting()' vim.cmd 'command! -buffer FormattingSync lua vim.lsp.buf.formatting_sync()' end end null_ls.setup { sources = { null_ls.builtins.diagnostics.eslint_d.with(opts.eslint_diagnostics), null_ls.builtins.formatting.eslint_d.with(opts.eslint_formatting), null_ls.builtins.formatting.prettier.with(opts.prettier_formatting), null_ls.builtins.formatting.stylua.with(opts.stylua_formatting), null_ls.builtins.formatting.elm_format.with(opts.elm_format_formatting), null_ls.builtins.code_actions.eslint_d.with(opts.eslint_diagnostics), }, on_attach = on_attach, } end, }, { 'williamboman/mason.nvim', build = ':MasonUpdate', config = function() require('mason').setup() end, }, { 'williamboman/mason-lspconfig.nvim', config = function() require('mason-lspconfig').setup { ensure_installed = { 'lua_ls' }, -- Replace with your LSP servers } end, }, { 'jay-babu/mason-null-ls.nvim', config = function() require('mason-null-ls').setup { ensure_installed = { 'eslint', 'eslint_d', 'prettier' }, -- Replace with formatters/linters you want automatic_installation = true, } end, }, { 'VonHeikemen/lsp-zero.nvim', branch = 'v4.x', }, { 'neovim/nvim-lspconfig' }, { 'hrsh7th/cmp-nvim-lsp' }, { 'hrsh7th/nvim-cmp' }, { 'MunifTanjim/prettier.nvim' }, { 'f-person/git-blame.nvim' }, { 'nvim-neo-tree/neo-tree.nvim', branch = 'v3.x', dependencies = { 'nvim-lua/plenary.nvim', 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended 'MunifTanjim/nui.nvim', -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information }, }, { 'SmiteshP/nvim-navic', dependencies = { 'neovim/nvim-lspconfig', }, }, { 'folke/persistence.nvim', event = 'BufReadPre', -- this will only start session saving when an actual file was opened opts = { -- add any custom options here }, config = function() require('persistence').setup() end, }, { 'echasnovski/mini.nvim', version = '*', config = function() require('mini.icons').setup() require('mini.sessions').setup() end, }, { 'utilyre/barbecue.nvim', name = 'barbecue', version = '*', dependencies = { 'SmiteshP/nvim-navic', 'nvim-tree/nvim-web-devicons', -- optional dependency }, opts = { -- configurations go here }, config = function() require('barbecue').setup { create_autocmd = false, -- prevent barbecue from updating itself automatically } vim.api.nvim_create_autocmd({ 'WinScrolled', -- or WinResized on NVIM-v0.9 and higher 'BufWinEnter', 'CursorHold', 'InsertLeave', -- include this if you have set `show_modified` to `true` -- "BufModifiedSet", }, { group = vim.api.nvim_create_augroup('barbecue.updater', {}), callback = function() require('barbecue.ui').update() end, }) end, }, { 'karb94/neoscroll.nvim', config = function() require('neoscroll').setup { duration_multiplier = 0.4, } end, }, { 'xiyaowong/transparent.nvim', config = function() require('transparent').setup { -- table: default groups groups = { 'Normal', 'NormalNC', 'Comment', 'Constant', 'Special', 'Identifier', 'Statement', 'PreProc', 'Type', 'Underlined', 'Todo', 'String', 'Function', 'Conditional', 'Repeat', 'Operator', 'Structure', 'LineNr', 'NonText', 'SignColumn', 'CursorLine', 'CursorLineNr', 'StatusLine', 'StatusLineNC', 'EndOfBuffer', }, -- table: additional groups that should be cleared extra_groups = { 'NormalFloat', 'NvimTreeNormal', }, -- table: groups you don't want to clear exclude_groups = {}, -- function: code to be executed after highlight groups are cleared -- Also the user event "TransparentClear" will be triggered on_clear = function() end, } end, }, { 'sphamba/smear-cursor.nvim', opts = { -- Smear cursor when switching buffers or windows. smear_between_buffers = true, -- Smear cursor when moving within line or to neighbor lines. smear_between_neighbor_lines = true, -- Draw the smear in buffer space instead of screen space when scrolling scroll_buffer_space = true, -- Set to `true` if your font supports legacy computing symbols (block unicode symbols). -- Smears will blend better on all backgrounds. legacy_computing_symbols_support = false, stiffness = 0.8, -- 0.6 [0, 1] trailing_stiffness = 0.5, -- 0.3 [0, 1] distance_stop_animating = 0.5, -- 0.1 > 0 hide_target_hack = false, -- true boolean }, }, { 'ThePrimeagen/vim-be-good' }, }