-- ┌────────────────────┐ -- │ Welcome to MiniMax │ -- └────────────────────┘ -- -- This is a config designed to mostly use MINI. It provides out of the box -- a stable, polished, and feature rich Neovim experience. Its structure: -- -- ├ init.lua Initial (this) file executed during startup -- ├ plugin/ Files automatically sourced during startup -- ├── 10_options.lua Built-in Neovim behavior -- ├── 20_keymaps.lua Custom mappings -- ├── 30_mini.lua MINI configuration -- ├── 40_plugins.lua Plugins outside of MINI -- ├ snippets/ User defined snippets (has demo file) -- ├ after/ Files to override behavior added by plugins -- ├── ftplugin/ Files for filetype behavior (has demo file) -- ├── lsp/ Language server configurations (has demo file) -- ├── snippets/ Higher priority snippet files (has demo file) -- -- Config files are meant to be read, preferably inside a Neovim instance running -- this config and opened at its root. This will help you better understand your -- setup. Start with this file. Any order is possible, prefer the one listed above. -- Ways of navigating your config: -- - `` + `e` + (one of) `iokmp` - edit 'init.lua' or 'plugin/' files. -- - Inside config directory: `ff` (picker) or `ed` (explorer) -- - Navigate existing buffers with `[b`, `]b`, or `fb`. -- -- Config files are also meant to be customized. Initially it is a baseline of -- a working config based on MINI. Modify it to make it yours. Some approaches: -- - Modify already existing files in a way that keeps them consistent. -- - Add new files in a way that keeps config consistent. -- Usually inside 'plugin/' or 'after/'. -- -- Documentation comments like this can be found throughout the config. -- Common conventions: -- -- - See `:h key-notation` for key notation used. -- - `:h xxx` means "documentation of helptag xxx". Either type text directly -- followed by Enter or type `fh` to open a helptag fuzzy picker. -- - "Type `fh`" means "press , followed by f, followed by h". -- Unless said otherwise, it assumes that Normal mode is current. -- - "See 'path/to/file'" means see open file at described path and read it. -- - `:SomeCommand ...` or `:lua ...` means execute mentioned command. -- Bootstrap 'mini.nvim' manually in a way that it gets managed by 'mini.deps' local mini_path = vim.fn.stdpath('data') .. '/site/pack/deps/start/mini.nvim' if not vim.loop.fs_stat(mini_path) then vim.cmd('echo "Installing `mini.nvim`" | redraw') local origin = 'https://github.com/nvim-mini/mini.nvim' local clone_cmd = { 'git', 'clone', '--filter=blob:none', origin, mini_path } vim.fn.system(clone_cmd) vim.cmd('packadd mini.nvim | helptags ALL') vim.cmd('echo "Installed `mini.nvim`" | redraw') end -- Plugin manager. Set up immediately for `now()`/`later()` helpers. -- Example usage: -- - `MiniDeps.add('...')` - use inside config to add a plugin -- - `:DepsUpdate` - update all plugins -- - `:DepsSnapSave` - save a snapshot of currently active plugins -- -- See also: -- - `:h MiniDeps-overview` - how to use it -- - `:h MiniDeps-commands` - all available commands -- - 'plugin/30_mini.lua' - more details about 'mini.nvim' in general require('mini.deps').setup() -- Define config table to be able to pass data between scripts -- It is a global variable which can be use both as `_G.Config` and `Config` _G.Config = {} -- Define custom autocommand group and helper to create an autocommand. -- Autocommands are Neovim's way to define actions that are executed on events -- (like creating a buffer, setting an option, etc.). -- -- See also: -- - `:h autocommand` -- - `:h nvim_create_augroup()` -- - `:h nvim_create_autocmd()` local gr = vim.api.nvim_create_augroup('custom-config', {}) Config.new_autocmd = function(event, pattern, callback, desc) local opts = { group = gr, pattern = pattern, callback = callback, desc = desc } vim.api.nvim_create_autocmd(event, opts) end -- Some plugins and 'mini.nvim' modules only need setup during startup if Neovim -- is started like `nvim -- path/to/file`, otherwise delaying setup is fine Config.now_if_args = vim.fn.argc(-1) > 0 and MiniDeps.now or MiniDeps.later -- CUSTOM vim.keymap.set('n', 'L', ':bn') vim.keymap.set('n', 'H', ':bp') MiniDeps.add({ source = 'projekt0n/github-nvim-theme', checkout = "main" }) vim.api.nvim_create_autocmd("FileType", { pattern = "qf", callback = function() -- Map to select the item and then close the quickfix/location list vim.keymap.set("n", "", ":cclose", { buffer = true }) end, })