Skip to content

echasnovski/mini.basics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GitHub license

Common configuration presets

See more details in Features and help file.


⦿ 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

demo-basics.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 <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 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 <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 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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages