echasnovski / mini.nvim
- вторник, 28 февраля 2023 г. в 00:13:44
Library of 20+ independent Lua modules improving overall Neovim (version 0.7 and higher) experience with minimal effort
Library of 20+ independent Lua modules improving overall Neovim (version 0.7 and higher) experience with minimal effort. They all share same configuration approaches and general design principles.
Think about this project as "Swiss Army knife" among Neovim plugins: it has many different independent tools (modules) suitable for most common tasks. Each module can be used separately without any startup and usage overhead.
If you want to help this project grow but don't know where to start, check out contributing guides or leave a Github star for 'mini.nvim' project and/or any its standalone Git repositories.
There are two branches to install from:
main
(default, recommended) will have latest development version of plugin. All changes since last stable release should be perceived as being in beta testing phase (meaning they already passed alpha-testing and are moderately settled).stable
will be updated only upon releases with code tested during public beta-testing phase in main
branch.Here are code snippets for some common installation methods:
Branch | Code snippet |
---|---|
Main | { 'echasnovski/mini.nvim', version = false }, |
Stable | { 'echasnovski/mini.nvim', version = '*' }, |
Branch | Code snippet |
---|---|
Main | use 'echasnovski/mini.nvim' |
Stable | use { 'echasnovski/mini.nvim', branch = 'stable' } |
Branch | Code snippet |
---|---|
Main | Plug 'echasnovski/mini.nvim' |
Stable | Plug 'echasnovski/mini.nvim', { 'branch': 'stable' } |
Important: don't forget to call module's setup()
(if required) to enable its functionality.
Note: if you are on Windows, there might be problems with too long file paths (like error: unable to create file <some file name>: Filename too long
). Try doing one of the following:
git config --system core.longpaths true
. Then try to reinstall.Module | Description | Overview | Details |
---|---|---|---|
mini.ai | Extend and create a /i textobjects |
README | Help file |
mini.align | Align text interactively | README | Help file |
mini.animate | Animate common Neovim actions | README | Help file |
mini.base16 | Base16 colorscheme creation | README | Help file |
mini.basics | Common configuration presets | README | Help file |
mini.bracketed | Go forward/backward with square brackets | README | Help file |
mini.bufremove | Remove buffers | README | Help file |
mini.comment | Comment | README | Help file |
mini.completion | Completion and signature help | README | Help file |
mini.cursorword | Autohighlight word under cursor | README | Help file |
mini.doc | Generate Neovim help files | README | Help file |
mini.fuzzy | Fuzzy matching | README | Help file |
mini.indentscope | Visualize and operate on indent scope | README | Help file |
mini.jump | Jump to next/previous single character | README | Help file |
mini.jump2d | Jump within visible lines | README | Help file |
mini.map | Window with buffer text overview | README | Help file |
mini.misc | Miscellaneous functions | README | Help file |
mini.move | Move any selection in any direction | README | Help file |
mini.pairs | Autopairs | README | Help file |
mini.sessions | Session management | README | Help file |
mini.starter | Start screen | README | Help file |
mini.statusline | Statusline | README | Help file |
mini.surround | Surround actions | README | Help file |
mini.tabline | Tabline | README | Help file |
mini.test | Test Neovim plugins | README | Help file |
mini.trailspace | Trailspace (highlight and remove) | README | Help file |
Extend and create a
/i
textobjects (like in di(
or va"
).
a(
, a)
, a'
, and more), creates new ones (like a*
, a<Space>
, af
, a?
, and more), and allows user to create their own (like based on treesitter, and more).v:count
, different search methods, consecutive application, and customization via Lua patterns or functions.For video demo and quick overview see its README. For more details see its help file.
Align text interactively (with or without instant preview).
For video demo and quick overview see its README. For more details see its help file.
Animate common Neovim actions (works out of the box without extra mappings or commands needed).
For video demo and quick overview see its README. For more details see its help file.
Fast implementation of chriskempson/base16 theme for manually supplied palette.
For video demo and quick overview see its README. For more details see its help file.
Common configuration presets
For video demo and quick overview see its README. For more details see its help file.
Go forward/backward with square brackets
For video demo and quick overview see its README. For more details see its help file.
Buffer removing (unshow, delete, wipeout), which saves window layout.
For video demo and quick overview see its README. For more details see its help file.
Fast and familiar per-line commenting.
For video demo and quick overview see its README. For more details see its help file.
Autocompletion and signature help plugin.
For video demo and quick overview see its README. For more details see its help file.
Automatic highlighting of word under cursor (displayed after customizable delay).
For video demo and quick overview see its README. For more details see its help file.
Generation of help files from EmmyLua-like annotations. Allows flexible customization of output via hook functions. Used for documenting this plugin.
For video demo and quick overview see its README. For more details see its help file.
Minimal and fast fuzzy matching.
For video demo and quick overview see its README. For more details see its help file.
Visualize and operate on indent scope. Supports customization of debounce delay, animation style, and different granularity of options for scope computing algorithm.
For video demo and quick overview see its README. For more details see its help file.
Smarter jumping to next/previous single character.
For video demo and quick overview see its README. For more details see its help file.
Jump within visible lines via iterative label filtering.
For video demo and quick overview see its README. For more details see its help file.
Window with buffer text overview, scrollbar, and highlights.
For video demo and quick overview see its README. For more details see its help file.
Miscellaneous useful functions.
For video demo and quick overview see its README. For more details see its help file.
Move any selection in any direction.
For video demo and quick overview see its README. For more details see its help file.
Minimal and fast autopairs.
For video demo and quick overview see its README. For more details see its help file.
Session management (read, write, delete).
For video demo and quick overview see its README. For more details see its help file.
Fast and flexible start screen
For video demo and quick overview see its README. For more details see its help file.
Minimal and fast statusline module with opinionated default look.
For video demo and quick overview see its README. For more details see its help file.
Fast and feature-rich surround plugin
v:count
, different search methods, "last"/"next" extended mappings, customization via Lua patterns or functions, and more.For video demo and quick overview see its README. For more details see its help file.
Minimal and fast tabline showing listed buffers
For video demo and quick overview see its README. For more details see its help file.
Write and use extensive Neovim plugin tests
For video demo and quick overview see its README. For more details see its help file.
Work with trailing whitespace
For video demo and quick overview see its README. For more details see its help file.
Design. Each module is designed to solve a particular problem targeting balance between feature-richness (handling as many edge-cases as possible) and simplicity of implementation/support. Granted, not all of them ended up with the same balance, but it is the goal nevertheless.
Independence. Modules are independent of each other and can be run without external dependencies. Although some of them may need dependencies for full experience.
Structure. Each module is a submodule for a placeholder "mini" module. So, for example, "surround" module should be referred to as "mini.surround". As later will be explained, this plugin can also be referred to as "MiniSurround".
Setup:
Each module (if needed) should be setup separately with require(<name of module>).setup({})
(possibly replace {} with your config table or omit to use defaults). You can supply only values which differ from defaults, which will be used for the rest ones.
Call to module's setup()
always creates a global Lua object with coherent camel-case name: require('mini.surround').setup()
creates _G.MiniSurround
. This allows for a simpler usage of plugin functionality: instead of require('mini.surround')
use MiniSurround
(or manually :lua MiniSurround.*
in command line); available from v:lua
like v:lua.MiniSurround
. Considering this, "module" and "Lua object" names can be used interchangeably: 'mini.surround' and 'MiniSurround' will mean the same thing.
Each supplied config
table is stored in config
field of global object. Like MiniSurround.config
.
Values of config
, which affect runtime activity, can be changed on the fly to have effect. For example, MiniSurround.config.n_lines
can be changed during runtime; but changing MiniSurround.config.mappings
won't have any effect (as mappings are created once during setup()
).
Buffer local configuration. Each module can be additionally configured to use certain runtime config settings locally to buffer. See mini.nvim-buffer-local-config
section in help file for more information.
Disabling. Each module's core functionality can be disabled globally or locally to buffer. See "Disabling" section in module's help page for more details. See mini.nvim-disabling-recipes
section in main help file for common recipes.
Silencing. Each module can be configured to not show non-error feedback globally or locally to buffer. See "Silencing" section in module's help page for more details.
Highlight groups. Appearance of module's output is controlled by certain highlight group (see :h highlight-groups
). To customize them, use highlight
command. Note: currently not many Neovim themes support this plugin's highlight groups; fixing this situation is highly appreciated. To see a more calibrated look, use MiniBase16 or plugin's colorscheme minischeme
.
Stability. Each module upon release is considered to be relatively stable: both in terms of setup and functionality. Any non-bugfix backward-incompatible change will be released gradually as much as possible.
This plugin comes with several color schemes (all of them are made with 'mini.base16' and have both dark and light variants):
minischeme
- blue and yellow main colors with high contrast and saturation palette. All examples use this colorscheme.minicyan
- cyan and grey main colors with moderate contrast and saturation palette.Activate them as regular colorscheme
(for example, :colorscheme minicyan
). You can see how they look in demo of 'mini.base16'.
This is the list of modules I currently intend to implement eventually (as my free time and dedication will allow), in alphabetical order: