echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
5.25k stars 189 forks source link

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

Closed Jarmos-san closed 2 years ago

Jarmos-san commented 2 years ago

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

echasnovski commented 2 years ago

To disable autodrawing, set g:miniindentscope_disable (globally) or b:miniindentscope_disable (for a buffer) to v:true. Considering high number of different scenarios and customization intentions, writing exact rules for disabling module's functionality is left to user. See mini.nvim-disabling-recipes for common recipes.

Edit: interestingly enough, I ended up adopting this design choice exactly to avoid having to implement all kinds of indentscope_*_exclude. At this point, this is my strong opinion about this topic.