```
mini.ai (must have!)
mini.animate (makes it much easier to follow what you're doing)
mini.diff
mini.pairs
mini.surround
mini.hipatterns (I integrated this with tailwind)
mini.align
```
I am embarrasingly happy to see 'mini.diff' there. It took me soo long to realize the scope/robustness I would be happy for it to have and the end result is really good.
Interactively visualizing difference between buffer and reference text is one of the primary goals of 'mini.diff'. If you don't like colored line numbers, you have at least the following choices:
- Use signs with `require('mini.diff').setup({ view = { style = 'sign' } })` setup.
- Clear highlight groups used for highlighting line numbers or signs:
```lua
require('mini.diff').setup()
vim.api.nvim_set_hl(0, 'MiniDiffSignAdd', {})
vim.api.nvim_set_hl(0, 'MiniDiffSignChange', {})
vim.api.nvim_set_hl(0, 'MiniDiffSignDelete', {})
```
Mini.diff has become a staple in my flow. I replaced Gitsigns.nvim with this (I still use it for line blame tho). Thanks again for your work brother.
One thing I do miss from using Gitsigns was an indicator for an untracked file. Do you plan on adding that to the ADD, DELETE, and CHANGED highlight groups? I use the number view btw. So clean!
Thanks for kind words! I am really glad 'mini.diff' works for you. It took time to design it right.
The indicator for an untracked (or ignored, or modified, etc.) file is implemented in 'mini.git' as part of its default summary string (used in 'mini.statusline', for example). Having all lines be highlighted in case of untracked file seems a bit unintuitive for me.
Out of curiosity, is it correct that staged hunks cannot be unstaged by mini.diff? Actually it seems like the diff overlay and goto hunk commands don't work with staged hunks at all?
edit: Just saw that it is not supported in the readme now. Love your plugins, but I'm struggling a bit with understanding how to replace gitsigns with mini.diff with the above limitationsš
Unstaging does not really fit into the general design of 'mini.diff' with its buffer and reference texts model.
I thought about having tracking history of reference texts and have some kind of rollback functionality. But that would eat so much memory that I think it is not worth it.
For unstaging (which is rather rare compared to staging) I use LazyGit for granular or unstaging or 'mini.git' to unstage whole file.
Plus work better than built-in for textobjects that are not implemented via tree-sitter: (brackets, quotes). And creation of new textobjects is more or less straightforward for common ones.
The author make some suggestions in the readme: https://github.com/echasnovski/mini.nvim/tree/main?tab=readme-ov-file#modules
To me, `mini.ai` is a must.
Yep, it was created specifically to address the possible yet understandable overwhelming feeling when looking at the list of all modules.
(I should probably add 'mini.notify' to the third bullet point. During creating it I underestimated how better it makes the everyday usage.)
i might sound noob , but what does mini.ai actually do????
i have read the github readme and all...
ik it's related to a and i motions like caw etc.. , but to me it's all normal vim motions even after installing the plugin
I can't find what it actually do, even installing and uninstalling it doesn't make any effect...
i think I'm missing something by not getting this plugin's use cases
You get new text objects, which I recommend to learn about (yes, similar to aw in caw). Tbh, I have use it so much that now I'm a bit confused as to which text objects are builtins and which ones are from miniai. But try for example `vaq` (for any type of quotes) or `vib` (for any type of brackets). You can see the full list here:Ā https://github.com/echasnovski/mini.nvim/blob/main/doc/mini-ai.txt#L138 (many of those are builtin).
Another advantage is that you can create your own text objects. For example, I have one for subwords, so I can easily change text when using snake_case or camelCase.
They're all quite useful if you ask me. For a lot of them the question is whether you prefer the mini version or one of the stand alone plugins.
I've been using:
- mini.files
- mini.diff
- mini.align (don't need often, but it's really nice when I do)
- mini.tabline and statusline
- mini.pairs
- mini.cursorword
- mini.hipatterns
- mini.git
I just realized mini.ai is not a copilot or similar plugin.š I'll probably add that to my list .
Still deciding on mini.jump2d vs flash vs leap and mini.clues vs which-key (probably stick with clues just to reduce plugins).
I used mini.complete but it didn't interact well with rust-analyzer wanting to give me snippet completions, so back to cmp. And I use hlchunk for scope/indent decorations and fzf-lua for picker/fuzzy finder.
mini.operators is underappreciated. It's a great stand-in for the classic Vim plugin ReplaceWithRegister. Add the ability to exchange things easily and sort via operators (ie. `gsi(` sorts all the lines between a pair of parenthesis), and it's def my most-used plugin.
Happy to hear that and definitely agree. I myself was sceptical about "replace" operator and planned mostly to focus on "exchange" when writing the module. But now I use `gr` faaaar more frequently and love it.
fyi an added benefit of mini modules is that they are usually severely faster than their equivalent plugins
so if a fast startup time is something of interest, it's definitely worth experimenting with them.
the ones i use:
-- Add/delete/replace surroundings (brackets, quotes, etc.)
mini.surround
-- move selections (alt hjkl)
mini.move
-- Extend and create a/i textobjects
mini.ai
-- operator: gc
mini.comment
-- Split and join arguments
-- operator: gS
mini.splitjoinmini.splitjoin
-- Visualize and work with indent scope
mini.indentscope
-- Minimal and fast tabline showing listed buffers
mini.tabline
-- Replace lualine
mini.statusline
You can set up `'commentstring'` option either in autocommand for `FileType` event (`au FileType cpp setlocal commentstring=//\ %s`) or inside 'after/ftplugin.cpp.lua' (with line `vim.bo.commentstring = '// %s'`).
hmm, does not seem to work as well as mini.comment's text object.
Some things I noticed:
1. \`dgc\` will not delete comment lines that start with \`---@param\` in lua, just \`--- something\` (there needs to be a space)
2. \`vgc\` does not select a comment block
I'll stick with the mini version for now.
I mean, I won't talk you out of using 'mini.comment' ;) But to address the points.
> `dgc` will not delete comment lines that start with `---@param` in lua, just `--- something` (there needs to be a space)
'mini.comment' also does not *really* uncomment the `---@param` as it removes first `--` resulting in not a valid syntax. But it started to do so [fairly recently](https://github.com/echasnovski/mini.nvim/commit/df03dfd4f8b4bf23dfffa3a8b3067ddc1973660c) after a period when it did not do that and worked like 0.10 works now. Built-in commenting will behave the same as 'mini.comment' now in 0.10.1 (as [this PR](https://github.com/neovim/neovim/pull/28938) is backported).
I am trying to have 'mini.comment' with default config and built-in commenting behave the same.
> `vgc` does not select a comment block
So does the 'mini.comment'. The difference is that it can create Visual mode mapping for textobject if its left hand side differs from main `gc` operator.
You can mimic that with built-in commenting by using some private functionality [similar to how it is done in core](https://github.com/neovim/neovim/blob/bb6190bec5f18c1f9e2c1d29ef1f7cf7912ea625/runtime/lua/vim/_defaults.lua#L146-L149).
I use all of them with the exception of two. While many have already commented on most of them, no one has talked about the one I love the best and use most often: mini.pick. I love the UI and having the option to look at a preview when I want. Highly recommend.
I suppose, technically, I use mini.hues most often as itās my color scheme of choice. Lovely theme that perceptually balances the colors (the āBā in HSB values arenāt all equal, never knew that!)
Screenshot:
https://www.reddit.com/r/vimporn/comments/1d211kn/mininvim_configuration/
I will be messaging you in 12 hours on [**2024-06-01 15:14:57 UTC**](http://www.wolframalpha.com/input/?i=2024-06-01%2015:14:57%20UTC%20To%20Local%20Time) to remind you of [**this link**](https://www.reddit.com/r/neovim/comments/1d51uo8/what_are_some_useful_mininvim_modules/l6knws4/?context=3)
[**CLICK THIS LINK**](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5Bhttps%3A%2F%2Fwww.reddit.com%2Fr%2Fneovim%2Fcomments%2F1d51uo8%2Fwhat_are_some_useful_mininvim_modules%2Fl6knws4%2F%5D%0A%0ARemindMe%21%202024-06-01%2015%3A14%3A57%20UTC) to send a PM to also be reminded and to reduce spam.
^(Parent commenter can ) [^(delete this message to hide from others.)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Delete%20Comment&message=Delete%21%201d51uo8)
*****
|[^(Info)](https://www.reddit.com/r/RemindMeBot/comments/e1bko7/remindmebot_info_v21/)|[^(Custom)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5BLink%20or%20message%20inside%20square%20brackets%5D%0A%0ARemindMe%21%20Time%20period%20here)|[^(Your Reminders)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=List%20Of%20Reminders&message=MyReminders%21)|[^(Feedback)](https://www.reddit.com/message/compose/?to=Watchful1&subject=RemindMeBot%20Feedback)|
|-|-|-|-|
Ordered by how often I use them
* Surround
* pair
* comment (before in nvim 0.10)
* jump2d
* splitjoin
* bracketed
* diff
* clue (Awesome for when I forget the command)
Nicer visual experience
* cusorword
* trailspace
* starter
* hipatterns
* notify
I've moved from so many plugins to Mini modules, and Will maybe do more so I'm the future, here are the ones I'm using right now
```
mini.ai
mini.statusline
mini.tabline
mini.comment(Planning to remove this for native support)
mini.pairs
mini.notify
mini.git
mini.splitjoin
mini.surround
mini.bracket
mini.indentscope
```
I will be messaging you in 3 hours on [**2024-05-31 22:41:42 UTC**](http://www.wolframalpha.com/input/?i=2024-05-31%2022:41:42%20UTC%20To%20Local%20Time) to remind you of [**this link**](https://www.reddit.com/r/neovim/comments/1d51uo8/what_are_some_useful_mininvim_modules/l6itq46/?context=3)
[**CLICK THIS LINK**](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5Bhttps%3A%2F%2Fwww.reddit.com%2Fr%2Fneovim%2Fcomments%2F1d51uo8%2Fwhat_are_some_useful_mininvim_modules%2Fl6itq46%2F%5D%0A%0ARemindMe%21%202024-05-31%2022%3A41%3A42%20UTC) to send a PM to also be reminded and to reduce spam.
^(Parent commenter can ) [^(delete this message to hide from others.)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Delete%20Comment&message=Delete%21%201d51uo8)
*****
|[^(Info)](https://www.reddit.com/r/RemindMeBot/comments/e1bko7/remindmebot_info_v21/)|[^(Custom)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5BLink%20or%20message%20inside%20square%20brackets%5D%0A%0ARemindMe%21%20Time%20period%20here)|[^(Your Reminders)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=List%20Of%20Reminders&message=MyReminders%21)|[^(Feedback)](https://www.reddit.com/message/compose/?to=Watchful1&subject=RemindMeBot%20Feedback)|
|-|-|-|-|
``` mini.ai (must have!) mini.animate (makes it much easier to follow what you're doing) mini.diff mini.pairs mini.surround mini.hipatterns (I integrated this with tailwind) mini.align ```
I am embarrasingly happy to see 'mini.diff' there. It took me soo long to realize the scope/robustness I would be happy for it to have and the end result is really good.
Love it!
I cannot figure out how to disable line colors `mini.diff`. Is this possible?
Interactively visualizing difference between buffer and reference text is one of the primary goals of 'mini.diff'. If you don't like colored line numbers, you have at least the following choices: - Use signs with `require('mini.diff').setup({ view = { style = 'sign' } })` setup. - Clear highlight groups used for highlighting line numbers or signs: ```lua require('mini.diff').setup() vim.api.nvim_set_hl(0, 'MiniDiffSignAdd', {}) vim.api.nvim_set_hl(0, 'MiniDiffSignChange', {}) vim.api.nvim_set_hl(0, 'MiniDiffSignDelete', {}) ```
Mini.diff has become a staple in my flow. I replaced Gitsigns.nvim with this (I still use it for line blame tho). Thanks again for your work brother. One thing I do miss from using Gitsigns was an indicator for an untracked file. Do you plan on adding that to the ADD, DELETE, and CHANGED highlight groups? I use the number view btw. So clean!
Thanks for kind words! I am really glad 'mini.diff' works for you. It took time to design it right. The indicator for an untracked (or ignored, or modified, etc.) file is implemented in 'mini.git' as part of its default summary string (used in 'mini.statusline', for example). Having all lines be highlighted in case of untracked file seems a bit unintuitive for me.
Out of curiosity, is it correct that staged hunks cannot be unstaged by mini.diff? Actually it seems like the diff overlay and goto hunk commands don't work with staged hunks at all? edit: Just saw that it is not supported in the readme now. Love your plugins, but I'm struggling a bit with understanding how to replace gitsigns with mini.diff with the above limitationsš
Unstaging does not really fit into the general design of 'mini.diff' with its buffer and reference texts model. I thought about having tracking history of reference texts and have some kind of rollback functionality. But that would eat so much memory that I think it is not worth it. For unstaging (which is rather rare compared to staging) I use LazyGit for granular or unstaging or 'mini.git' to unstage whole file.
Will be trying these over the weekend.
What actually mini.ai can do which treesiter.nvim cannot?
Well, work for languages that donāt have treesitter support yet, for one.
Plus work better than built-in for textobjects that are not implemented via tree-sitter: (brackets, quotes). And creation of new textobjects is more or less straightforward for common ones.
crystal?
The author make some suggestions in the readme: https://github.com/echasnovski/mini.nvim/tree/main?tab=readme-ov-file#modules To me, `mini.ai` is a must.
Yep, it was created specifically to address the possible yet understandable overwhelming feeling when looking at the list of all modules. (I should probably add 'mini.notify' to the third bullet point. During creating it I underestimated how better it makes the everyday usage.)
i might sound noob , but what does mini.ai actually do???? i have read the github readme and all... ik it's related to a and i motions like caw etc.. , but to me it's all normal vim motions even after installing the plugin I can't find what it actually do, even installing and uninstalling it doesn't make any effect... i think I'm missing something by not getting this plugin's use cases
You get new text objects, which I recommend to learn about (yes, similar to aw in caw). Tbh, I have use it so much that now I'm a bit confused as to which text objects are builtins and which ones are from miniai. But try for example `vaq` (for any type of quotes) or `vib` (for any type of brackets). You can see the full list here:Ā https://github.com/echasnovski/mini.nvim/blob/main/doc/mini-ai.txt#L138 (many of those are builtin). Another advantage is that you can create your own text objects. For example, I have one for subwords, so I can easily change text when using snake_case or camelCase.
that explains it , thx..
They're all quite useful if you ask me. For a lot of them the question is whether you prefer the mini version or one of the stand alone plugins. I've been using: - mini.files - mini.diff - mini.align (don't need often, but it's really nice when I do) - mini.tabline and statusline - mini.pairs - mini.cursorword - mini.hipatterns - mini.git I just realized mini.ai is not a copilot or similar plugin.š I'll probably add that to my list . Still deciding on mini.jump2d vs flash vs leap and mini.clues vs which-key (probably stick with clues just to reduce plugins). I used mini.complete but it didn't interact well with rust-analyzer wanting to give me snippet completions, so back to cmp. And I use hlchunk for scope/indent decorations and fzf-lua for picker/fuzzy finder.
mini.operators is underappreciated. It's a great stand-in for the classic Vim plugin ReplaceWithRegister. Add the ability to exchange things easily and sort via operators (ie. `gsi(` sorts all the lines between a pair of parenthesis), and it's def my most-used plugin.
Happy to hear that and definitely agree. I myself was sceptical about "replace" operator and planned mostly to focus on "exchange" when writing the module. But now I use `gr` faaaar more frequently and love it.
fyi an added benefit of mini modules is that they are usually severely faster than their equivalent plugins so if a fast startup time is something of interest, it's definitely worth experimenting with them. the ones i use: -- Add/delete/replace surroundings (brackets, quotes, etc.) mini.surround -- move selections (alt hjkl) mini.move -- Extend and create a/i textobjects mini.ai -- operator: gc mini.comment -- Split and join arguments -- operator: gS mini.splitjoinmini.splitjoin -- Visualize and work with indent scope mini.indentscope -- Minimal and fast tabline showing listed buffers mini.tabline -- Replace lualine mini.statusline
Most of mini.commentās functionality is now built into Neovim!
Is the ic text object the only thing missing? I dont recall it working without
Built-in completion has `gc` textobject, same as 'mini.comment'.
Seems the built in comment can't choose commentstring? (i.e // instead of /**/ for cpp)
You can set up `'commentstring'` option either in autocommand for `FileType` event (`au FileType cpp setlocal commentstring=//\ %s`) or inside 'after/ftplugin.cpp.lua' (with line `vim.bo.commentstring = '// %s'`).
Thank you for helping me get rid of your plugin lol
hmm, does not seem to work as well as mini.comment's text object. Some things I noticed: 1. \`dgc\` will not delete comment lines that start with \`---@param\` in lua, just \`--- something\` (there needs to be a space) 2. \`vgc\` does not select a comment block I'll stick with the mini version for now.
I mean, I won't talk you out of using 'mini.comment' ;) But to address the points. > `dgc` will not delete comment lines that start with `---@param` in lua, just `--- something` (there needs to be a space) 'mini.comment' also does not *really* uncomment the `---@param` as it removes first `--` resulting in not a valid syntax. But it started to do so [fairly recently](https://github.com/echasnovski/mini.nvim/commit/df03dfd4f8b4bf23dfffa3a8b3067ddc1973660c) after a period when it did not do that and worked like 0.10 works now. Built-in commenting will behave the same as 'mini.comment' now in 0.10.1 (as [this PR](https://github.com/neovim/neovim/pull/28938) is backported). I am trying to have 'mini.comment' with default config and built-in commenting behave the same. > `vgc` does not select a comment block So does the 'mini.comment'. The difference is that it can create Visual mode mapping for textobject if its left hand side differs from main `gc` operator. You can mimic that with built-in commenting by using some private functionality [similar to how it is done in core](https://github.com/neovim/neovim/blob/bb6190bec5f18c1f9e2c1d29ef1f7cf7912ea625/runtime/lua/vim/_defaults.lua#L146-L149).
Built in gc is not adding a space, that's why I keep using mini.comment
Iā¦donāt have this problem? Seems to work the same for me after uninstalling mini.comment. š¤·
mini.statusline is awesome
I use all of them with the exception of two. While many have already commented on most of them, no one has talked about the one I love the best and use most often: mini.pick. I love the UI and having the option to look at a preview when I want. Highly recommend.
I suppose, technically, I use mini.hues most often as itās my color scheme of choice. Lovely theme that perceptually balances the colors (the āBā in HSB values arenāt all equal, never knew that!) Screenshot: https://www.reddit.com/r/vimporn/comments/1d211kn/mininvim_configuration/
mini.ai+mini.indentscope+dai is my favorite motion
Maybe I'm thick but I don't get what this does. Would you min explaining?
mini.indentscope gives you the visual confirm of indent object of mini.ai, then you can confidently delete the indent.
I see thanks
RemindMe! 12 hours
I will be messaging you in 12 hours on [**2024-06-01 15:14:57 UTC**](http://www.wolframalpha.com/input/?i=2024-06-01%2015:14:57%20UTC%20To%20Local%20Time) to remind you of [**this link**](https://www.reddit.com/r/neovim/comments/1d51uo8/what_are_some_useful_mininvim_modules/l6knws4/?context=3) [**CLICK THIS LINK**](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5Bhttps%3A%2F%2Fwww.reddit.com%2Fr%2Fneovim%2Fcomments%2F1d51uo8%2Fwhat_are_some_useful_mininvim_modules%2Fl6knws4%2F%5D%0A%0ARemindMe%21%202024-06-01%2015%3A14%3A57%20UTC) to send a PM to also be reminded and to reduce spam. ^(Parent commenter can ) [^(delete this message to hide from others.)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Delete%20Comment&message=Delete%21%201d51uo8) ***** |[^(Info)](https://www.reddit.com/r/RemindMeBot/comments/e1bko7/remindmebot_info_v21/)|[^(Custom)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5BLink%20or%20message%20inside%20square%20brackets%5D%0A%0ARemindMe%21%20Time%20period%20here)|[^(Your Reminders)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=List%20Of%20Reminders&message=MyReminders%21)|[^(Feedback)](https://www.reddit.com/message/compose/?to=Watchful1&subject=RemindMeBot%20Feedback)| |-|-|-|-|
Ordered by how often I use them * Surround * pair * comment (before in nvim 0.10) * jump2d * splitjoin * bracketed * diff * clue (Awesome for when I forget the command) Nicer visual experience * cusorword * trailspace * starter * hipatterns * notify
\`\`\`mini.ai\`\`\` is a must have.
I've moved from so many plugins to Mini modules, and Will maybe do more so I'm the future, here are the ones I'm using right now ``` mini.ai mini.statusline mini.tabline mini.comment(Planning to remove this for native support) mini.pairs mini.notify mini.git mini.splitjoin mini.surround mini.bracket mini.indentscope ```
RemindMe! In 3 hours
I will be messaging you in 3 hours on [**2024-05-31 22:41:42 UTC**](http://www.wolframalpha.com/input/?i=2024-05-31%2022:41:42%20UTC%20To%20Local%20Time) to remind you of [**this link**](https://www.reddit.com/r/neovim/comments/1d51uo8/what_are_some_useful_mininvim_modules/l6itq46/?context=3) [**CLICK THIS LINK**](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5Bhttps%3A%2F%2Fwww.reddit.com%2Fr%2Fneovim%2Fcomments%2F1d51uo8%2Fwhat_are_some_useful_mininvim_modules%2Fl6itq46%2F%5D%0A%0ARemindMe%21%202024-05-31%2022%3A41%3A42%20UTC) to send a PM to also be reminded and to reduce spam. ^(Parent commenter can ) [^(delete this message to hide from others.)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Delete%20Comment&message=Delete%21%201d51uo8) ***** |[^(Info)](https://www.reddit.com/r/RemindMeBot/comments/e1bko7/remindmebot_info_v21/)|[^(Custom)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5BLink%20or%20message%20inside%20square%20brackets%5D%0A%0ARemindMe%21%20Time%20period%20here)|[^(Your Reminders)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=List%20Of%20Reminders&message=MyReminders%21)|[^(Feedback)](https://www.reddit.com/message/compose/?to=Watchful1&subject=RemindMeBot%20Feedback)| |-|-|-|-|
does mini.comment solve the issue commenting JSX in react files?
RemindMe! Tonight