8000 mini.nvim/lua/mini/init.lua at main · aarnphm/mini.nvim · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
386 lines (382 loc) · 20.9 KB

init.lua

File metadata and controls

386 lines (382 loc) · 20.9 KB
--- local (from current directory) sessions.
---
--- - |MiniSplitjoin| - split and join arguments (regions inside brackets
--- between allowed separators). Has customizable pre and post hooks.
--- Works inside comments.
---
--- - |MiniStarter| - minimal, fast, and flexible start screen. Displayed items
--- are fully customizable both in terms of what they do and how they look
--- (with reasonable defaults). Item selection can be done using prefix query
--- with instant visual feedback.
---
--- - |MiniStatusline| - minimal and fast statusline. Has ability to use custom
--- content supplied with concise function (using module's provided section
--- functions) along with builtin default. For full experience needs
--- enabled |MiniDiff|, |MiniGit|, and |MiniIcons| modules (but works without
--- any of them).
---
--- - |MiniSurround| - fast and feature-rich surround plugin. Add, delete,
--- replace, find, highlight surrounding (like pair of parenthesis, quotes,
--- etc.). Supports dot-repeat, `v:count`, different search methods,
--- "last"/"next" extended mappings, customization via Lua patterns or
--- functions, and more. Has builtins for brackets, function call, tag, user
--- prompt, and any alphanumeric/punctuation/whitespace character.
---
--- - |MiniTest| - framework for writing extensive Neovim plugin tests.
--- Supports hierarchical tests, hooks, parametrization, filtering (like from
--- current file or cursor position), screen tests, "busted-style" emulation,
--- customizable reporters, and more. Designed to be used with provided
--- wrapper for managing child Neovim processes.
---
--- - |MiniTabline| - minimal tabline which always shows listed (see 'buflisted')
--- buffers. Allows showing extra information section in case of multiple vim
--- tabpages. For full experience needs enabled |MiniIcons| module (but works
--- without it).
---
--- - |MiniTrailspace| - automatic highlighting of trailing whitespace with
--- functionality to remove it.
---
--- - |MiniVisits| - track and reuse file system visits. Tracks data about each
--- file/directory visit (after delay) and stores it (only) locally. This can be
--- used to get a list of "recent"/"frequent"/"frecent" visits.
--- Allows persistently adding labels to visits enabling flexible workflow.
--- Common recipes for disabling functionality
---
--- Each module's core functionality can be disabled globally or buffer-locally
--- by creating appropriate global or buffer-scoped variables equal to |v:true|.
--- Functionality is disabled if at least one of |g:| or |b:| variables is `v:true`.
---
--- Variable names have the same structure: `{g,b}:mini*_disable` where `*` is
--- module's lowercase name. For example, `g:minianimate_disable` disables
--- |mini.animate| globally and `b:minianimate_disable` - for current buffer.
--- Note: in this section disabling 'mini.animate' is used as example;
--- everything holds for other module variables.
---
--- Considering high number of different scenarios and customization intentions,
--- writing exact rules for disabling module's functionality is left to user.
---
--- # Manual disabling ~
--- >lua
--- -- Disable globally
--- vim.g.minianimate_disable = true
---
--- -- Disable for current buffer
--- vim.b.minianimate_disable = true
---
--- -- Toggle (disable if enabled, enable if disabled)
--- vim.g.minianimate_disable = not vim.g.minianimate_disable -- globally
--- vim.b.minianimate_disable = not vim.b.minianimate_disable -- for buffer
--- <
--- # Automated disabling ~
---
--- Automated disabling is suggested to be done inside autocommands: >lua
---
--- -- Disable for a certain filetype (for example, "lua")
--- local f = function(args) vim.b[args.buf].minianimate_disable = true end
--- vim.api.nvim_create_autocmd('Filetype', { pattern = 'lua', callback = f })
---
--- -- Enable only for certain filetypes (for example, "lua" and "help")
--- local f = function(args)
--- local ft = vim.bo[args.buf].filetype
--- if ft == 'lua' or ft == 'help' then return end
--- vim.b[args.buf].minianimate_disable = true
--- end
--- vim.api.nvim_create_autocmd('Filetype', { callback = f })
---
--- -- Disable in Visual mode
--- local f_en = function(args) vim.b[args.buf].minianimate_disable = false end
--- local enable_opts = { pattern = '[vV\x16]*:*', callback = f_en }
--- vim.api.nvim_create_autocmd('ModeChanged', enable_opts)
---
--- local f_dis = function(args) vim.b[args.buf].minianimate_disable = true end
--- local disable_opts = { pattern = '*:[vV\x16]*', callback = f_dis }
--- vim.api.nvim_create_autocmd('ModeChanged', disable_opts)
---
--- -- Disable in Terminal buffer
--- local f = function(args) vim.b[args.buf].minianimate_disable = true end
--- vim.api.nvim_create_autocmd('TermOpen', { callback = f })
--- <
---@tag mini.nvim-disabling-recipes
--- Buffer local config
---
--- Each module can be additionally configured locally to buffer by creating
--- appropriate buffer-scoped variable with values you want to override. It
--- will affect only runtime options and not those used once during setup (like
--- `mappings` or `set_vim_settings`).
---
--- Variable names have the same structure: `b:mini*_config` where `*` is
--- module's lowercase name. For example, `b:minianimate_config` can store
--- information about how |mini.animate| will act inside current buffer. Its
--- value should be a table with same structure as module's `config`. Example: >lua
---
--- -- Disable scroll animation in current buffer
--- vim.b.minianimate_config = { scroll = { enable = false } }
--- <
--- Considering high number of different scenarios and customization intentions,
--- writing exact rules for module's buffer local configuration is left to
--- user. It is done in similar fashion to |mini.nvim-disabling- 32C9 recipes|.
---@tag mini.nvim-buffer-local-config
vim.notify([[Do not `require('mini')` directly. Setup every module separately.]])
return {}
0