mini.basics

mini.basics

Generated from the main branch of ‘mini.nvim’

Common configuration presets

See more details in Features and Documentation.


[!NOTE] This was previously hosted at a personal echasnovski GitHub account. It was transferred to a dedicated organization to improve long term project stability. See more details here.

⦿ This is a part of mini.nvim library. Please use this link 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’ or leave a Github star for ‘mini.nvim’ project and/or any its standalone Git repositories.

Demo

Features

  • Presets for common options. It will only change option if it wasn’t manually set before. See :h MiniBasics.config.options for more details.
  • Presets for common mappings. It will only add a mapping if it wasn’t manually created before. See :h MiniBasics.config.mappings for more details.
  • Presets for common autocommands. See :h MiniBasics.config.autocommands for more details.
  • 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
  • ‘mini.nvim’ library:

    Branch Code snippet
    Main Follow recommended ‘mini.deps’ installation
    Stable Follow recommended ‘mini.deps’ installation
  • Standalone plugin:

    Branch Code snippet
    Main add(‘nvim-mini/mini.basics’)
    Stable add({ source = ‘nvim-mini/mini.basics’, checkout = ‘stable’ })
With folke/lazy.nvim
  • ‘mini.nvim’ library:

    Branch Code snippet
    Main { 'nvim-mini/mini.nvim', version = false },
    Stable { 'nvim-mini/mini.nvim', version = '*' },
  • Standalone plugin:

    Branch Code snippet
    Main { 'nvim-mini/mini.basics', version = false },
    Stable { 'nvim-mini/mini.basics', version = '*' },
With junegunn/vim-plug
  • ‘mini.nvim’ library:

    Branch Code snippet
    Main Plug 'nvim-mini/mini.nvim'
    Stable Plug 'nvim-mini/mini.nvim', { 'branch': 'stable' }
  • Standalone plugin:

    Branch Code snippet
    Main Plug 'nvim-mini/mini.basics'
    Stable Plug 'nvim-mini/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 <some file name>: 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

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

    -- Extra UI features ('winblend', 'listchars', 'pumheight', ...)
    extra_ui = false,

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

  -- Mappings. Set field 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 <C-hjkl>, resize with <C-arrow>
    windows = false,

    -- Move cursor in Insert, Command, and Terminal mode with <M-hjkl>
    move_with_alt = false,
  },

  -- Autocommands. Set field 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