Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/echasnovski/mini.basics

Neovim Lua plugin with common configuration presets for options, mappings, and autocommands. Part of 'mini.nvim' library.
https://github.com/echasnovski/mini.basics

lua mini-nvim neovim neovim-plugin

Last synced: 3 days ago
JSON representation

Neovim Lua plugin with common configuration presets for options, mappings, and autocommands. Part of 'mini.nvim' library.

Awesome Lists containing this project

README

        

[![GitHub license](https://badgen.net/github/license/echasnovski/mini.nvim)](https://github.com/echasnovski/mini.nvim/blob/main/LICENSE)

### Common configuration presets

See more details in [Features](#features) and [help file](doc/mini-basics.txt).

---

⦿ This is a part of [mini.nvim](https://github.com/echasnovski/mini.nvim) library. Please use [this link](https://github.com/echasnovski/mini.nvim/blob/main/README.md) if you want to mention this module.

⦿ All contributions (issues, pull requests, discussions, etc.) are done inside of 'mini.nvim'.

⦿ See the repository page to learn about common design principles and configuration recipes.

---

If you want to help this project grow but don't know where to start, check out [contributing guides of 'mini.nvim'](https://github.com/echasnovski/mini.nvim/blob/main/CONTRIBUTING.md) or leave a Github star for 'mini.nvim' project and/or any its standalone Git repositories.

## Demo

https://user-images.githubusercontent.com/24854248/215277747-c0dea3eb-e8f7-4550-85ce-200b111fff55.mp4

## Features

- Presets for common options. It will only change option if it wasn't manually set before. See more in help file under `MiniBasics.config.options` tag.
- Presets for common mappings. It will only add a mapping if it wasn't manually created before. See more in help file under `MiniBasics.config.mappings` tag.
- Presets for common autocommands. See more in help file under `MiniBasics.config.autocommands` tag.
- Reverse compatibility is a high priority. Any decision to change already present behavior will be made with great care.

Notes:
- Main goal of this module is to provide a relatively easier way for new-ish Neovim users to have better "works out of the box" experience while having documented relevant options/mappings/autocommands to study. It is based partially on survey among Neovim users and partially is coming from personal preferences.

However, more seasoned users almost surely will find something useful.

Still, it is recommended to read about used options/mappings/autocommands and decide if they are needed. The main way to do that is by reading Neovim's help pages (linked in help file) and this module's source code (thoroughly documented for easier comprehension).

## Installation

This plugin can be installed as part of 'mini.nvim' library (**recommended**) or as a standalone Git repository.

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 (use only one):

With mini.deps



Github repo
Branch Code snippet




'mini.nvim' library Main Follow recommended 'mini.deps' installation


Stable


Standalone plugin Main add('echasnovski/mini.basics')


Stable add({ source = 'echasnovski/mini.basics', checkout = 'stable' })

With folke/lazy.nvim



Github repo
Branch Code snippet




'mini.nvim' library
Main { 'echasnovski/mini.nvim', version = false },


Stable { 'echasnovski/mini.nvim', version = '*' },


Standalone plugin
Main { 'echasnovski/mini.basics', version = false },


Stable { 'echasnovski/mini.basics', version = '*' },

With junegunn/vim-plug



Github repo
Branch Code snippet




'mini.nvim' library
Main Plug 'echasnovski/mini.nvim'


Stable Plug 'echasnovski/mini.nvim', { 'branch': 'stable' }


Standalone plugin Main Plug 'echasnovski/mini.basics'


Stable Plug 'echasnovski/mini.basics', { 'branch': 'stable' }


**Important**: don't forget to call `require('mini.basics').setup()` 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 : Filename too long`). Try doing one of the following:
- Enable corresponding git global config value: `git config --system core.longpaths true`. Then try to reinstall.
- Install plugin in other place with shorter path.

## Default config

```lua
-- No need to copy this inside `setup()`. Will be used automatically.
{
-- Options. Set to `false` to disable.
options = {
-- Basic options ('number', 'ignorecase', and many more)
basic = true,

-- Extra UI features ('winblend', 'cmdheight=0', ...)
extra_ui = false,

-- Presets for window borders ('single', 'double', ...)
win_borders = 'default',
},

-- Mappings. Set to `false` to disable.
mappings = {
-- Basic mappings (better 'jk', save with Ctrl+S, ...)
basic = true,

-- Prefix for mappings that toggle common options ('wrap', 'spell', ...).
-- Supply empty string to not create these mappings.
option_toggle_prefix = [[\]],

-- Window navigation with , resize with
windows = false,

-- Move cursor in Insert, Command, and Terminal mode with
move_with_alt = false,
},

-- Autocommands. Set to `false` to disable
autocommands = {
-- Basic autocommands (highlight on yank, start Insert in terminal, ...)
basic = true,

-- Set 'relativenumber' only in linewise and blockwise Visual mode
relnum_in_visual_mode = false,
},

-- Whether to disable showing non-error feedback
silent = false,
}
```

## Similar plugins

- [tpope/vim-sensible](https://github.com/tpope/vim-sensible)
- [tpope/vim-unimpaired](https://github.com/tpope/vim-unimpaired)