-- -- Copyright (c) 2026 Jan Fooken -- -- 40_packages.lua -- -- Add custom packages or plugins to enhance and customize Neovim's behaviour. -- -- For an overview of the preloaded plugins, see |plugins| (type :help -- plugins). For information on how packages are loaded, see |packages| (type -- :help packages) and |initialization| (type :help initialization). -- -- For information on how to use external plugins via the built-in plugin -- manager refer to the Lua module |vim.pack| (type :help vim.pack). -- local pack = vim.pack pack.add { 'https://github.com/neovim/nvim-lspconfig', 'https://github.com/nvim-mini/mini.align', 'https://github.com/nvim-mini/mini.completion', 'https://github.com/nvim-mini/mini.hipatterns', 'https://github.com/nvim-mini/mini.hues', 'https://github.com/nvim-mini/mini.icons', 'https://github.com/nvim-mini/mini.misc', 'https://github.com/nvim-mini/mini.pick', 'https://github.com/nvim-mini/mini.statusline', 'https://github.com/nvim-mini/mini.tabline', 'https://github.com/nvim-mini/mini.trailspace', } -- Color Scheme ================================================================ do -- Use minisummer as color scheme, because it has a big plugin integration. -- Try miniwinter, minispring. minisummer, miniautumn or the "default" scheme. -- If you're feeling lucky, try randomhue. vim.cmd.colorscheme 'minisummer' end -- Editing ===================================================================== do -- In Normal or Visual mode type `ga` (or `gA` to show preview) to trigger the -- interactive alignment assistant. See |MiniAlign| for information on how to -- use this plugin. This mapping overrides the builtin |ga| key mapping. require('mini.align').setup() end do -- Configure the builtin LSP |lsp-quickstart| and autocomplete via -- |mini.completion|. Predefined server settings come from the nvim-lspconfig -- plugin, but can be overridden and merged via an |after-directory|. See -- |lsp-config-merge|. For information on default mappings, refer to -- |lsp-defaults| and |mini.completion|. require('mini.completion').setup({}) -- Enable Go language support vim.lsp.enable 'gopls' -- Enable Python language support vim.lsp.enable 'pyright' end -- Search ====================================================================== do -- Minimal fuzzy finder for a lot of things. There are a dozen more fuzzy -- finders: fzf, telescope and grug-far are the most popular. For more -- information on this one, look at |mini.pick|. require('mini.pick').setup() -- Search the word under the cursor, analog to |*|. vim.keymap.set( 'n', '*', 'Pick grep pattern=""', { desc = 'Find word' } ) -- Search for a grep pattern, analog to |/|, but doesn't have the same -- semantics. vim.keymap.set( 'n', '/', 'Pick grep_live', { desc = 'Find pattern' } ) -- Search for files. The mapping `ff` is quick to type and easy to -- remember. Just think [F]ind [F]iles. vim.keymap.set( 'n', 'ff', 'Pick files', { desc = 'Find files' } ) end -- UI ========================================================================== do -- Highlight special words. See |mini.hipatterns|. local hipatterns = require 'mini.hipatterns' hipatterns.setup { highlighters = { -- Highlight standalone FIXME, HACK, NOTE and TODO fixme = { pattern = { '%f[%w]()FIXME()%f[%W]', '%f[%w]()Fixme()%f[%W]', '%f[%w]()fixme()%f[%W]', }, group = 'MiniHipatternsFixme', }, hack = { pattern = { '%f[%w]()HACK()%f[%W]', '%f[%w]()Hack()%f[%W]', '%f[%w]()hack()%f[%W]', }, group = 'MiniHipatternsHack', }, note = { pattern = { '%f[%w]()NOTE()%f[%W]', '%f[%w]()Note()%f[%W]', '%f[%w]()note()%f[%W]', }, group = 'MiniHipatternsNote', }, todo = { pattern = { '%f[%w]()TODO()%f[%W]', '%f[%w]()Todo()%f[%W]', '%f[%w]()todo()%f[%W]', }, group = 'MiniHipatternsTodo', }, -- Highlight hex color strings like #rrggbb using that corresponding color hex_color = hipatterns.gen_highlighter.hex_color(), }, } end do -- An icon provider for LSP, statusline, tabline and co. Also accessible via -- the global variable MiniIcons. See |mini.icons|. local mini_icons = require 'mini.icons' mini_icons.setup() -- Add support for plugins that don't support |mini.icons|. mini_icons.mock_nvim_web_devicons() -- Add icons to LSP completion items. Adds significantly to startup time. mini_icons.tweak_lsp_kind() end do -- A fancy statusline with optional Git and diff related information. -- Optional features require mini.git or gitsigns.nvim, or mini.diff. See -- |mini.statusline| and the following URLs for more information: -- - https://nvim-mini.org/mini.nvim/readmes/mini-git -- - https://github.com/lewis6991/gitsigns.nvim -- - https://nvim-mini.org/mini.nvim/readmes/mini-diff require('mini.statusline').setup() end do -- Display a tabline for easier management of open buffers and showing their -- modification state. See |mini.tabline|, |]b|, |[b|, |]B| and |[B|. require('mini.tabline').setup() end do -- Highlight trailing whitespace in Normal buffers. See |mini.trailspace|. require('mini.trailspace').setup() end -- Miscellaneous =============================================================== do local misc = require 'mini.misc' misc.setup() local opts = {} if vim.env.TERM_PROGRAM == 'Apple_Terminal' then -- On Terminal.app, an explicit reset is required, because the terminal -- doesn't seem to support the OSC 111 control sequence, so it doesn't reset -- the background to its default value. opts['explicit_reset'] = true end -- Synchronize the background of the terminal emulator to remove the -- discoloration around Neovim. misc.setup_termbg_sync(opts) end