Giter Club home page Giter Club logo

mini.nvim's Introduction


GitHub license GitHub tag Current version

Library of 35+ 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.

Table of contents

Installation

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:

  • Manually with git clone (compatible with mini.deps):
-- Put this at the top of 'init.lua'
local path_package = vim.fn.stdpath('data') .. '/site'
local mini_path = path_package .. '/pack/deps/start/mini.nvim'
if not vim.loop.fs_stat(mini_path) then
  vim.cmd('echo "Installing `mini.nvim`" | redraw')
  local clone_cmd = {
    'git', 'clone', '--filter=blob:none',
    -- Uncomment next line to use 'stable' branch
    -- '--branch', 'stable',
    'https://github.com/echasnovski/mini.nvim', mini_path
  }
  vim.fn.system(clone_cmd)
  vim.cmd('packadd mini.nvim | helptags ALL')
end
Branch Code snippet
Main { 'echasnovski/mini.nvim', version = false },
Stable { 'echasnovski/mini.nvim', version = '*' },
Branch Code snippet
Main Plug 'echasnovski/mini.nvim'
Stable Plug 'echasnovski/mini.nvim', { 'branch': 'stable' }
  • Every module is also distributed as a standalone Git repository. Check out module's information for more details.

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:

  • Enable corresponding git global config value: git config --system core.longpaths true. Then try to reinstall.
  • Install plugin in other place with shorter path.

Modules

If you are browsing without particular objective and don't know which module to look at:

  • To improve your editing experience, start with 'mini.ai', 'mini.operators', 'mini.surround'.
  • To improve your general workflow, start with 'mini.bracketed', 'mini.files', 'mini.jump2d', 'mini.pick'.
  • To make your Neovim more beautiful, start with 'mini.animate', 'mini.hipatterns', 'mini.hues'.
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.clue Show next key clues README Help file
mini.colors Tweak and save any color scheme README Help file
mini.comment Comment lines README Help file
mini.completion Completion and signature help README Help file
mini.cursorword Autohighlight word under cursor README Help file
mini.deps Plugin manager README Help file
mini.diff Work with diff hunks README Help file
mini.doc Generate Neovim help files README Help file
mini.extra Extra 'mini.nvim' functionality README Help file
mini.files Navigate and manipulate file system README Help file
mini.fuzzy Fuzzy matching README Help file
mini.hipatterns Highlight patterns in text README Help file
mini.hues Generate configurable color scheme README Help file
mini.indentscope Visualize and work with 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.notify Show notifications README Help file
mini.operators Text edit operators README Help file
mini.pairs Autopairs README Help file
mini.pick Pick anything README Help file
mini.sessions Session management README Help file
mini.splitjoin Split and join arguments 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
mini.visits Track and reuse file system visits README Help file

General principles

  • 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 providing non-error feedback can be configured to not do that by setting config.silent = true (either inside setup() call or on the fly).

  • 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 'mini.hues', 'mini.base16', or any of plugin's colorscheme.

  • 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.

  • Not filetype/language specific. Including functionality which needs several filetype/language specific implementations is an explicit no-goal of this project. This is mostly due to the potential increase in maintenance to keep implementation up to date. However, any part which might need filetype/language specific tuning should be designed to allow it by letting user set proper buffer options and/or local configuration.

Plugin colorschemes

This plugin comes with several color schemes (all have both dark and light variants):

  • randomhue - random background and foreground of the same hue with medium saturation.
  • minicyan - cyan and grey main colors with medium contrast and saturation palette.
  • minischeme - blue and yellow main colors with high contrast and saturation palette.

Activate them as regular colorscheme (for example, :colorscheme randomhue or :colorscheme minicyan). You can see how they look in demo of 'mini.hues' or demo of 'mini.base16'.

Planned modules

This is the list of modules I currently intend to implement eventually (as my free time and dedication will allow), in alphabetical order:

  • 'mini.cycle' - cycle through alternatives with pre-defined rules. Something like monaqa/dial.nvim and AndrewRadev/switch.vim
  • 'mini.git' - utilities for more convenient work with Git. Actual scope is to be defined.
  • 'mini.keymap' - utilities to make non-trivial mappings (like max397574/better-escape.nvim and dot-repeatable mappings).
  • 'mini.snippets' - work with snippets. Something like L3MON4D3/LuaSnip but only with more straightforward functionality.
  • 'mini.statuscolumn' - customizable 'statuscolumn'.
  • 'mini.terminals' - coherently manage terminal windows and send text from buffers to terminal windows. Something like kassio/neoterm.
  • 'mini.quickfix' - fuzzy search and preview of quickfix entries. Possibly with some presets for populating quickfix list (like files, help tags, etc.). Similar to kevinhwang91/nvim-bqf.

mini.nvim's People

Contributors

alex-courtis avatar annenpolka avatar athepeanut4 avatar briandipalma avatar cassin01 avatar cbochs avatar chaucerbao avatar cryptomilk avatar dundargoc avatar echasnovski avatar gpanders avatar kawarimidoll avatar levouh avatar marcusandre avatar mcanueste avatar mehalter avatar raffaem avatar stasjok avatar tani avatar thenyeguy avatar tortitast avatar wroyca avatar xigoi avatar yamin-shihab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mini.nvim's Issues

mini.comment: error when commenting out empty line

Contributing guidelines

Module(s)

mini.comment

Description

Toggling comment on an empty line results in

E5108: Error executing lua ...nvim/site/pack/packer/opt/mini.nvim/lua/mini/comment.lua:129: Vim(lua):E5108: Error executing lua ...nvim/site/pack/pac
ker/opt/mini.nvim/lua/mini/comment.lua:320: attempt to index local 'indent' (a nil value)

Neovim version

0.6

Steps to reproduce

  1. Toggle comment on an empty line (default gcc)

Expected behavior

The line should be replaced with an empty comment.

Actual behavior

The above error is thrown.

Beta-testing 'mini.starter'

Please leave your feedback about new 'mini.starter' module here. Feel free to either add new comment or positively upvote existing one.

Some things that I am interested to find out (besides seemingly omnipresent bugs):

  • Are configuration and function names intuitive enough?
  • Are default values of settings convenient for you?
  • Is documentation clear enough? In particular, was it easy enough to find out about configurations similar to 'vim-startify' and 'dashboard-nvim'. Otherwise I understand that it might be a bit complex, but it is a price to pay for flexibility.

mini.comment disrespects indentation with tabs

Contributing guidelines

Module(s)

mini.comment

Description

Currently, mini.comment replaces indentation by tabs with the same number of spaces.

Neovim version

0.6

Steps to reproduce

  1. :set noexpandtab ts=4 sw=4 sts=0 nosmarttab
  2. In any buffer, type <tab><tab>asdf
  3. Toggle comment twice.

Expected behavior

The line \t\tasdf

Actual behavior

The line __asdf where _ is a space.

mini.surround latex operator?

Hey! You've created such an awesome plugin, such nice looking code (and there's not that much of it!). It has replaced many of my previous plugins and I am loving it. :) I have a feature request, for the surround module:

Is there a possibility of adding a latex "object"? It would be similar to the special_tag one, but with \begin{foo} and \end{foo} as left and right, rather than <foo>/</foo>.

I would have made this a PR, but I've had such little time lately that I thought I'd ask your opinion first.

Thanks!

Starter is shown when creating a new file

Contributing guidelines

Module(s)

mini.starter

Description

Greetings.

When I try to create a new file using nvim <filename>, instead of showing an empty file, ready to write in, the starter is shown, forcing me to use the "edit new buffer" option.

Thank you in advance.

Neovim version

0.6.1

Steps to reproduce

  1. nvim <filename> where "" is the name of a file that doesn't exist yet

Expected behavior

Nvim starts on an empty buffer, since a filename is present.

Actual behavior

Mini.starter is shown, like when I start nvim without any file name.

Customizable single character surroundings

Contributing guidelines

Module(s)

mini.surround

Description

Figure out a reasonable way to allow users supply their own single character surrounding. This should work for both 'input' (more complex and seems to be less needed) and 'output' (simpler and more in demand). Probably should be in the format of a table with find+extract for 'input' and left+right for 'output' (see special_* functions). Maybe allow them to be functions for interactive input.

Use cases:

  • Insert surrounding with spaces (#16).
  • Insert LaTeX operator (#6).
  • Maybe even insert on separate lines, but this is unlikely to fit here.

how to add spaces as pairs when inside a pair?

Contributing guidelines

Module(s)

mini.pairs

Description

Thanks for the excellent plugin! One small question though, how do I configure mini.pairs to make a pair of spaces but only when inside another pair? For example, if I enter:

{{ |

(where | is the cursor), I want it to output:

{{ | }}

Obviously, I do not want a pair of spaces when inserting something like:

text |

Obviously, I would like this for any char that is recognized as a pair, not just {.

Is this doable as is w/ a clever mapping? Or would you have to implement this in plugin code? I feel like the sample mapping for < in the wiki comes close but I can't figure out how to alter that to this need.

Thanks!

As an aside, while looking at the wiki example for < I realized I don't know how to add additional chars to the recognized pairs. The wiki says:

The following pairs are respected: `()`, `[]`, `{}`, `""`, `''`, `\`\``. 

But how would I add <> or '%%' (or some other arbitrary pairing) to that list? Is there a config var for it that I missed?

Mini.Sessions - save_current()

Contributing guidelines

Module(s)

Mini.Sessions

Description

There is no manual way to save session - only on quit (well there is session.write() but you would have to write current session name).
Problem is as follows:

  • when we work on session A,
  • we open mini.starter - and we then open session B, then session A wont be saved.

If we could run session.save_current() before calling mini.starter then problem is solved.

Even better if opening mini.starter() would save current session - it would have to be done, before mini.staarter() overrides current buffer content, so that we wont save mini.starter screen in session file.
I think startify did it best - when opening startify screen, it would:

  • save and close current session, if any is active (all buffers are closed)
  • open startify screen in new empty buffer (no session is active now)

Beta-testing 'mini.doc'

Please leave your feedback about new 'mini.doc' module here. Feel free to either add new comment or positively upvote existing one.

Some things that I am interested to find out (besides seemingly omnipresent bugs):

  • Are configuration and function names intuitive enough?
  • Are default values of settings convenient for you?
  • Is documentation clear enough?

Module proposition: test suite

Contributing guidelines

Module(s)

Test module

Description

Hello ! I would love mini.nvim to provide a mini implementation of a plugin test suite, for Lua plugins.
Currently, I use plenary test suite, and I think this could be improved.
What do you think ?

Beta-testing 'mini.jump'

Please leave your feedback about new 'mini.jump' module here. Feel free to either add new comment or positively upvote existing one.

Some things that I am interested to find out (besides seemingly omnipresent bugs):

  • Are configuration and function names intuitive enough?
  • Are default values of settings convenient for you?
  • Is documentation clear enough?

CR does not insert new line when completion popup is visible.

Contributing guidelines

Module(s)

mini.completion

Description

When completion is enabled, any time the completion popup is visible, pressing closes the popup but does not go to the next line. :imap <CR> shows nothing.

Neovim version

NVIM v0.7.0-dev+1376-g973e91007

Steps to reproduce

minimal.lua:

vim.api.nvim_command("packadd! mini")
require("mini.completion").setup()
  1. nvim -nu minimal.lua
  2. Trigger completion (CTRL-space)
  3. Press enter

Expected behavior

Popup goes away and newline is inserted.

Actual behavior

Popup goes away, but no newline is inserted.

Add terms to blocklist for mini.cursorword

Contributing guidelines

Module(s)

mini.cursorword

Description

I've completely switched to using mini.cursorword from vim-illuminate and I'm absolutely thrilled with it. Thanks!

One thing that I would like to see is a configuration option to add a list of words that should not be highlighted. For example, when working with a large JavaScript codebase, the import statements are often grouped together - thus not really necessary to highlight, as they are so easy to find:

Screen Shot 2022-01-12 at 14 54 44

So I'd like to be able to do something like:

config = {
  disable_highlighting = { 'import' }
}

Again, thanks for your consideration!

No fold error when opening session from mini.starter

Contributing guidelines

Module(s)

Mini.Sessions

Description

image
I get this error from time to time.

Neovim version

NVIM v0.7.0-dev+1129-g30c9c8815

Steps to reproduce

  1. Open session from mini starter
  2. Sometimes no fold error will popup

Expected behavior

No response

Actual behavior

Not sure is this is mini problem, since the line mentioned in error, has just session so xxx command.

Cannot find color scheme 'base16-custom'

If I create a colorscheme using mini.base16, the plugin sets highlights and changes g:colors_name, but it doesn't actually register a colorscheme (selectable in :colorscheme). This causes Neovim's syntax loader to freak out:

Error detected while processing /usr/share/nvim/runtime/syntax/synload.vim:
line   19:
E185: Cannot find color scheme 'base16-custom'

In base16.lua on line 352, if I change vim.g.colors_name = name or 'base16-custom' to vim.g.colors_name = nil, this error goes away and nothing seems to break. However, there is probably a better way to do this.

Cant get any commands

Contributing guidelines

Module(s)

All modules

Description

Cant seem to get any command from any module even after requiring the module.
Eg: I have this in my init.lua

--- init.lua
require("mini.surround").setup{}
require("mini.tabline").setup{}
require("mini.starter").setup{}
require("mini.starter").open()

Upon startup of neovim tabline is visible and so do starter screen, but I can get any commands like

  • MiniStarter.refresh
  • MiniStarter.open
  • MiniSurround
    You get the point

Also I want to mention there's a spelling mistake in doc/mini.txt on line 27
expected: require('mini.surround')
actual : require('mini.suround')

Neovim version

NVIM v0.6.0-dev+604-g725cbe7d4 Build type: Release

Steps to reproduce

  1. Setup
-- init.lua
require("packer").startup(function()
use 'echasnovski/mini.nvim'
end
require("mini.surround").setup{}
  1. Start nvim
nvim .

Expected behavior

Command MiniSurround to work

Actual behavior

Error: MiniSurround command no found

Beta-testing 'mini.indentscope'

Please leave your feedback about new 'mini.indentscope' module here. Feel free to either add new comment or positively upvote existing one.

Some things that I am interested to find out (obviously, besides bugs):

  • Are configuration and function names intuitive enough?
  • Are default values of settings convenient for you?
  • Is documentation clear enough?

Spacing around parentheses/brackets

Thank you for a great plugin! I am amazed by how you have managed to cover so much functionality while still making it feel lightweight.

In surround.vim, if I have the cursor on the word "hello", and I hit ysiw), then it becomes "(hello)". If I had used ysiw(, then it would have been "( hello )" instead. The plugin uses the same pattern for other types of brackets too.
However, in mini.surround, it does not seem to make a difference whether I use saiw( or saiw), so I am wondering if I am missing anything, or if this is not supported?

add support for additionalTextEdits

Contributing guidelines

Module(s)

mini.completion

Description

Some lsp provide a additionalTextEdits on completion items containing useful edits like auto-imports.

nvim-cmp has support for additionalTextEdits, it would be cool if mini.completion had too.

Repeat jumps in either direction with f / f

Contributing guidelines

Module(s)

mini.jump

Description

In clever-f.vim, there is an option that after doing a backwards jump with 'F', you can repeat the jump (still moving backwards) with 'f'. In other words, when you are in the middle of a chain of jumps, 'f' means to keep going in the same direction as the initial jump of the chain, and 'F' means to go in the opposite direction. Similar logic applies to 't' and 'T'.

Not having to go back to holding the shift key after the initial backward jump is more ergonomic, and makes repeated jumps quicker and easier. It would be nice to see this functionality in mini.jump.

How to set indentscope hl_group?

It would be nice if there was a way to set the highlight group of the indentscope symbol.
A quick glance of vim.api.nvim_buf_set_extmark looks like you can pass the hl_group option to set the group.

indent-blankline.nvim and others allow this to be set as part of the configuration.
Maybe the indentscope configuration could be updated to supplement the symbol with a highlight group name, keeping backwards compatibility:

require('mini.indentscope').setup({
  symbol = "|",
  highlight = "Whitespace",
})

This could just be passed through a hl_group in extmark_opts in H.make_draw_function

function H.make_draw_function(indicator, opts)
local extmark_opts = {
hl_mode = 'combine',
priority = 2,
right_gravity = false,
virt_text = indicator.virt_text,
virt_text_pos = 'overlay',
}

I would expect the mark to use the Whitespace highlight group by default, but it appears that only the default highlight is used and merged with the background. The demo shows a blue indent mark, but it is otherwise unclear of how to control the coloring.

Query is not cleared after opening item

Contributing guidelines

Module(s)

Starter

Description

The problem happens after selecting an option in starter that opens a floating window and closing this window. The query is not emptied, which means I have to backspace a couple of times to retype the query. This is a small annoyance when you mistyped and try to type in the correct item, resulting in no active items being found.

This is especially notable when enabling the 'evaluate_single' option. When multiple windows have been opened using queries, every backspace triggers a reopening of the selected item.

Neovim version

Neovim nightly [NVIM v0.7.0-dev+995-g255935903]

Steps to reproduce

  1. nvim -nu minimal.lua (Packer with mini and telescope)
  2. Open starter
  3. Open browse files using the query
  4. Close Telescope

Expected behavior

Query resets after opening a floating window.

Actual behavior

Query is not reset and has to be reset manually to choose another option.

More granular configuration of 'mini.pairs'

Contributing guidelines

Module(s)

mini.pairs

Description

Think about a reasonably granular way to set up mapped pairs inside config. Desirable features:

  • Automatic registration of cursor neighborhoods which <BS> and <CR> will respect. This is the main point which greatly improves user-friendliness.
  • Don't be too complicated: both to implement and to use.
  • Should still allow using custom mappings as currently.

Better comments in mixed-language files with treesitter

Contributing guidelines

Module(s)

mini.comment

Description

I'm not sure whether this falls under Configurable (from module) comment structure. Modify |commentstring| instead, sorry if it does :)

I'm currently using https://github.com/numToStr/Comment.nvim and it has support for using the correct type of comment for each part of the file. For example

-- here it uses this prefix
vim.cmd [[
; here it uses this prefix
]]

I really like the gc text object feature from mini.comment but not having this kinda sucks, especially for files like .vue where the file is split pretty evenly between 3 different languages.

Latex comment string is not escaped properly

Contributing guidelines

Module(s)

mini.comment

Description

When commenting things using gcc (and others) in latex, an "invalid option %% to format" error is encountered and nothing gets commented. I believe it has to do with the fact that the latex commentstring is % (%%s to be precise), which is also used in formatting and not escaped properly.

Neovim version

0.6.0

Steps to reproduce

mini.lua:

require'packer'.startup {
  function()
  use {
    'echasnovski/mini.nvim',
    branch = 'stable',
    config = function()
      require'mini.comment'.setup()
    end
  }
  end
}
  1. Open any latex file: nvim -u mini.lua file.tex
  2. Try to comment something using gcc.

Expected behavior

The error does not occur and commenting works as with other commentstrings.

Actual behavior

Full error message:

E5108: Error executing lua ...im/site/pack/packer/start/mini.nvim/lua/mini/comment.lua:130: Vim(lua):E5108: Error executing lua ...im/site/pack/packer/start/mini.nvim/lua/mini/comment.lua:164: invalid option '%%' to 'format'
stack traceback:
	[C]: in function 'f'
	...im/site/pack/packer/start/mini.nvim/lua/mini/comment.lua:164: in function 'toggle_lines'
	[string ":lua"]:1: in main chunk
	[C]: in function 'cmd'
	...im/site/pack/packer/start/mini.nvim/lua/mini/comment.lua:130: in function <...im/site/pack/packer/start/mini.nvim/lua/mini/comment.lua:97>
stack traceback:
	[C]: in function 'cmd'
	...im/site/pack/packer/start/mini.nvim/lua/mini/comment.lua:130: in function <...im/site/pack/packer/start/mini.nvim/lua/mini/comment.lua:97>

"Scanning tags." when typing in insert mode

When I'm typing something in insert mode and there's no completion available, the command line keeps saying Scanning tags., which is really annoying. Would it be possible to get rid of this?

Beta-testing 'mini.sessions'

Please leave your feedback about new 'mini.sessions' module here. Feel free to either add new comment or positively upvote existing one.

Some things that I am interested to find out (besides seemingly omnipresent bugs):

  • Are configuration and function names intuitive enough? In particular, names read and write for managing session files. I understand that they are different from load and save in 'vim-startify', but are they intuitive enough for you?
  • Are default values of settings convenient for you?
  • Is documentation clear enough?

endwise

Contributing guidelines

Module(s)

pairs

Description

It would be nice to have endwise-like functionality, either as a new module or as a part of pairs. It gets annoying to type end when editing Lua and tpope's plugin doesn't cooperate well with other plugins that map <cr> in insert mode.

I could try to implement it. Looking at tpope's code, it's not that complex.

How do I ensure `mini.indentscope` ignores certain buffer types?

Contributing guidelines

Module(s)

mini.indentscope

Description

I noticed certain buffer types like help texts, "nvim-nerd-tree file explorer" & such shows the indent lines as well. Is there any way to disable that behaviour for a specific set of buffer types?

The behaviour would be more akin to what lukas-reineke/indent-blankline.nvim does with indent_blankline_filetype_exclude, indent_blankline_buftype_exclude, indent_blankline_bufname_exclude set to true.

Neovim version

0.6.1

Steps to reproduce

Easiest way to reproduce it is to enable mini.comment & then open a random help text in Neovim. Following is a screenshot which shows the unintended behaviour in action.

image

Expected behavior

Certain buffers like the terminal, help texts & such shouldn't show the indent line.

Actual behavior

Buffers which shouldn't show the indent lines in the first place shows them (see screenshot above for reference).

The WRAP functionality of the status line is annoying for those who have 'wrap' on all the time

The default status line has a functionality for showing WRAP next to the mode name when 'wrap' is on. I figure that this is intended to be helpful when you often switch the setting, but I don't think most Neovim users do that. I personally always have 'wrap' on and the indicator is completely redundant. I understand that I could just copy the default config and remove the line, but I'm questioning if it should be included in the default in the first place. I don't think it's generally useful, since you can usually easily tell if 'wrap' is on by looking at the screen. The same applies to SPELL for people who use it.

How to surround entire sentence?

Contributing guidelines

Module(s)

mini.surround

Description

In vim-surround plugin I could do yss( to surround the entire sentence with
() but that functionality didn't seem to be working with vim-sandwich. I have
changed the bindings to be similar to vim-surround's but I'm unable to do yss.

I can do Vys( but it'd be rather convenient to have yss.

Neovim version

0.6.1

Steps to reproduce

require("mini.surround").setup({
      -- Number of lines within which surrounding is searched
      n_lines = 20,

      -- Duration (in ms) of highlight when calling `MiniSurround.highlight()`
      highlight_duration = 500,

      -- Pattern to match function name in 'function call' surrounding
      -- By default it is a string of letters, '_' or '.'
      funname_pattern = "[%w_%.]+",

      -- Mappings. Use `''` (empty string) to disable one.
      mappings = {
      add = "ys", -- Add surrounding
      delete = "ds", -- Delete surrounding
      -- find = "sf", -- Find surrounding (to the right)
      -- find_left = "sF", -- Find surrounding (to the left)
      -- highlight = "sh", -- Highlight surrounding
      replace = "cs", -- Replace surrounding
      -- update_n_lines = "sn", -- Update `n_lines`
      },
})

Expected behavior

yss( surrounds the entire sentence with ( or respective object.

Actual behavior

mini.nvim plugin causes issue in loading bufferline.nvim

Contributing guidelines

Module(s)

mini.nvim

Description

I commented out mini.tabline and configured bufferline-nvim but bufferline-nvim wouldn't start until I comment out the entire configuration for mini.nvim in init.lua

Neovim version

0.6.1

Steps to reproduce

  1. nvim -nu minimal.lua
  2. Install mini.nvim
  3. Install bufferline-nvim
  4. Try loading bufferline-nvim with mini.nvim

Expected behavior

bufferline-nvim should load fine

Actual behavior

Add filetype option in each module's configuration

Contributing guidelines

Module(s)

All modules would be affected

Description

It would be nice to enable only specific filetypes when using specified module. I think of something like packer.nvim does, when you can load plugin only for associated filetypes.

In my case, it occurs that I want to use cursorword for code files, not especially for markdown files.

Such config as below could be a possible outcome of feature implementation.

use {
  "echasnovski/mini.nvim",
  config = function()
    require'mini.cursorword'.setup({
      -- Launch this module only when filetype match
      ft = { 'js', 'php', 'py' }
    })
  end
}

I am aware this can be done by hitting module's enable/disable toggle, e.g. in autocmd but that solution would be cleaner in configuration in my opinion.

Error when canceling surround with `<C-c>`

Contributing guidelines

Module(s)

mini.surround

Description

Whenever using a surround action other than add if the user cancels the surround character input with <C-c> instead of <Esc> the getchar() function returns an error

Neovim version

NVIM v0.7.0-dev+1292-ge9b53f3fb

Steps to reproduce

  1. nvim -nu minimal.lua
  2. Install mini.nvim with packerand run setup for mini.surround
  use {
    "echasnovski/mini.nvim",
    config = function()
      require("mini.surround").setup()
    end,
  }
  1. Position cursor over a word/character/etc
  2. Input the characters sd
  3. Cancel the surround motion with <C-c> (Control + c)

Expected behavior

The surround motion handles the keyboard interrupt input and the motion is aborted without any errors. User continues editing as normal

Actual behavior

Neovim throws an error and user is forced to pres some key to dismiss the error and continue editing

Error thrown:

E5108: Error executing lua Keyboard interrupt
stack traceback:
        [C]: in function 'getchar'
        ...m/site/pack/packer/start/mini.nvim/lua/mini/surround.lua:607: in function 'user_surround_id'
        ...m/site/pack/packer/start/mini.nvim/lua/mini/surround.lua:821: in function 'get_surround_info'
        ...m/site/pack/packer/start/mini.nvim/lua/mini/surround.lua:217: in function <...m/site/pack/packer/start/mini.nvim/lua/mini/surround.lua:215>

mini.cursorword features from vim-illuminate

Contributing guidelines

Module(s)

mini.cursorword

Description

I currently use vim-illuminate for this functionality and would love to use mini.cursorword but there are two features that are keeping me from making the switch:

  1. Don't mark/underline the word directly under the cursor. This is not a deal-breaker, but I find it a lot more intuitive, as I theoretically should already know where my cursor is, and I just want to see all other instances of that word in the current viewable area of the buffer.

Screen Shot 2022-01-03 at 08 52 57

  1. Change highlighting styles. I may have overlooked if this was a possibility, but I prefer highlighting with Visual rather than underline matches.

Thanks for this awesome collection of utilities!

MiniCompletion: Any negative consequences in using `autocmd! MiniCompletion InsertCharPre *` to disable auto-popup?

I wanted to use MiniCompletion with the default config. There was just one change: prevent the pop-up menu opening while typing. I know increasing the delay to a very high number is possible. I decided to go another way and disable just one of the autocmds in the MiniCompletion group:

   require('mini.completion').setup({})
   vim.cmd('   autocmd! MiniCompletion InsertCharPre *  ')

Everything works great: No more automatic pop-ups while I type. I can still use <C-Space> for that lovely, elegant two-stage completion (thanks to echasnovski). Are there any negative consequences to disabling that one InsertCharPre autocommand?

Mini.starter leaves an empty hidden buffer after selecting a file

Contributing guidelines

Module(s)

mini.starter

Description

Greetings,
Thanks for making this collection of modules!

There is a small problem regarding the "mini.starter" module: when I select a file from the "ministarter.sections.recent_files" a hidden buffer with no name is left, while the selected file is opened on another buffer.

If anything is unclear, feel free to ask any question.

Thank you in Advance!

Neovim version

0.6.1

Steps to reproduce

  1. Start nvim with mini installed (I used packer, removing all other plugins and leaving only mini.nvim, stable branch)
  2. Configure nvim to start mini.starter with the default configuration
  3. Open a recent file from the menu
  4. Use the ":ls" command to list open buffers

Expected behavior

I expect that the file I selected is opened in the current buffer

Actual behavior

According to ":ls" there is an empty "hidden" buffer, followed by another buffer containing the file I just opened.

Hooks for pre and post commenting

Contributing guidelines

Module(s)

mini.comment

Description

Add config.hooks = {pre = nil, post = nil} options. config.hooks.pre should be called before (potentially successful?) commenting; config.hooks.post - after successful commenting.

The most important application is to allow multi-language support through manually adjusting commentstring option in hooks.pre. See: JoosepAlviste/nvim-ts-context-commentstring and #50.

loading nvim-tree messes up with mini.starter

Contributing guidelines

Module(s)

mini.starter

Description

Even with minimal configuration of https://github.com/kyazdani42/nvim-tree.lua

require("nvim-tree").setup({})

messes up with mini.starter

I don't see any startup screen when I load nvim-tree.lua

Neovim version

0.6.1

Steps to reproduce

  1. nvim -nu minimal.lua
  2. install nvim-tree.lua and mini.starter
  3. require("nvim-tree").setup({})
  4. now mini.starter stops working

Expected behavior

mini.starter should work even when loading nvim-tree

Actual behavior

MiniPairs.unmap_buf not working

Contributing guidelines

Module(s)

pairs

Description

Hi, and thanks for a great plugin!

I am trying to get pairs to ignore ' for all my lisp-related files, and put this

lua MiniPairs.unmap_buf(0, 'i', "'", "''")

into after/ftplugin/sceme.vim, but I get the error

E5108: Error executing lua ...nvim/site/pack/packer/start/mini.nvim/lua/mini/pairs.lua:211: E31: No such mapping

My config is very simple:

            'echasnovski/mini.nvim',
            branch = 'stable',
            config = function()
                require'mini.pairs'.setup({
                    modes = { insert = true, command = true, terminal = true },
                })
            end
        }

It is very possible that I am just making a silly noob lua mistake, obviously, but I can't pinpoint what exactly that could be.

Neovim version

0.6.1

Steps to reproduce

  1. nvim -nu minimal.lua test.scm with minimal.lua looking like this:
vim.cmd([[
augroup packer_user_config
autocmd!
autocmd BufWritePost plugins.lua source <afile> | PackerCompile
augroup end
]])

vim.cmd [[packadd packer.nvim]]
vim.cmd [[packadd termdebug]]
return require('packer').startup({
    function()
        use {
            'echasnovski/mini.nvim',
            branch = 'stable',
            config = function()
                require'mini.pairs'.setup({
                    modes = { insert = true, command = true, terminal = true },
                })
            end
        }
    end,
})

This gives the error described above, and typing ' gives ''

Expected behavior

No error, typing ' does not trigger ''

Actual behavior

Typing ' gives ''

(mini.surround) Cannot surround with f or F motions

Contributing guidelines

Module(s)

mini.surround

Description

With the following config:

require("mini.surround").setup {
	mappings = {
		add = "s",
		delete = "ds",
		replace = "cs",
	}
}

I am able to use most motions, including t and T, but cannot surround with vim's vanilla f or F motions.

Neovim version

NVIM v0.7.0-dev+848-gb4fbb9dcf

Steps to reproduce

  1. Verify that <surround.add>t<char> and <surround.add>T<char> work
  2. Attempt to use <surround.add>f<char> and <surround.add>F<char>

Expected behavior

No response

Actual behavior

Pressing f or F in surround's operator pending mode seems to just exit the mode and carry out the normal f/F motion (finding a character).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.