-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Add condition
option in statuscolumn.
#288
Comments
Can you be more explicit on what you want here? |
Of course, I think I don't have a huge understanding of how the plugin works. I just finished finals so I will have more time to explore. But what I mean, more specifically, is having a condition parameter to render signs, or the column itself. Here is exactly why that is useful, from the local function is_neominimap(arg)
return vim.bo[arg.buf].filetype == "neominimap"
end
local function is_not_neominimap(arg)
return not is_neominimap(arg)
end
return {
"luukvbaal/statuscol.nvim",
opts = function()
local builtin = require("statuscol.builtin")
return {
setopt = true,
relculright = true,
segments = {
-- These segments will be shown for normal buffers
{
sign = {
namespace = { ".*" },
name = { ".*" },
},
condition = { is_not_neominimap },
},
{
text = {
builtin.lnumfunc,
" ",
builtin.foldfunc,
},
condition = { is_not_neominimap },
},
{
sign = {
namespace = { "gitsigns_" },
},
condition = { is_not_neominimap },
},
-- These segments will be shown for minimap buffers
{
sign = {
namespace = { "neominimap_search" },
maxwidth = 1,
colwidth = 1, -- For more compact look
},
condition = { is_neominimap },
},
{
sign = {
namespace = { "neominimap_git" },
maxwidth = 1,
colwidth = 1,
},
condition = { is_neominimap },
},
},
}
end,
} From my understanding, All in all this is probably not an important change, although it would allow me move from statuscol completely over to Snacks. As far as the "padding", It would be nice if the statuscolumn had one less column, but after looking through the other issues, I can't be confident in ruling out that there isn't another plugin that is messing with the statuscolumn. I will be looking into that when I have time this week. |
Just added something where you can now have statuscolumn = {
left = function(win, buf)
local is_neominimap = vim.bo[buf].filetype == "neominimap"
return is_neominimap and { "mark" } or { "mark", "sign" }
end,
right = function(win, buf)
local is_neominimap = vim.bo[buf].filetype == "neominimap"
return is_neominimap and { "fold" } or { "fold", "git" }
end,
},
|
🤖 I have created a release *beep* *boop* --- ## [2.11.0](v2.10.0...v2.11.0) (2024-12-15) ### Features * **indent:** properly handle continuation indents. Closes [#286](#286) ([f2bb7fa](f2bb7fa)) * **input:** allow configuring position of prompt and icon ([d0cb707](d0cb707)) * **notifier:** notification `history` option ([#297](#297)) ([8f56e19](8f56e19)) * **scope:** `Scope:inner` for indent based and treesitter scopes ([8a8b1c9](8a8b1c9)) * **scope:** added `__tostring` for debugging ([94e0849](94e0849)) * **scope:** added `opts.cursor` to take cursor column into account for scope detection. (defaults to true). Closes [#282](#282) ([54bc6ba](54bc6ba)) * **scope:** text objects now use treesitter scopes by default. See [#231](#231) ([a953697](a953697)) * **statuscolumn:** allow left/right to be a function. Closes [#288](#288) ([cb42b95](cb42b95)) * **util:** on_key handler ([002d5eb](002d5eb)) * **win:** win:line() ([17494ad](17494ad)) ### Bug Fixes * **dashboard:** telescope can't be run from a `vim.schedule` for some reason ([dcc5338](dcc5338)) * **indent:** `opts.indent.blank` now defaults to `listchars.space`. Closes [#291](#291) ([31bc409](31bc409)) * **indent:** fixup ([14d71c3](14d71c3)) * **indent:** honor lead listchar ([#303](#303)) ([7db0cc9](7db0cc9)) * **indent:** honor listchars and list when blank is `nil`. Closes [#296](#296) ([0e150f5](0e150f5)) * **indent:** lower priorities of indent guides ([7f66818](7f66818)) * **input:** check if parent win still exists. Fixes [#287](#287) ([db768a5](db768a5)) * **input:** go back to insert mode if input was started from insert mode. Fixes [#287](#287) ([5d00e6d](5d00e6d)) * **input:** missing padding if neither title nor icon positioned left ([#292](#292)) ([97542a7](97542a7)) * **input:** open input window with `noautocmd=true` set. Fixes [#287](#287) ([26b7d4c](26b7d4c)) * **scope:** add `indent` to `__eq` ([be2779e](be2779e)) * **scope:** better treesitter scope edge detection ([b7355c1](b7355c1)) * **scroll:** check mousescroll before spamming ([3d67bda](3d67bda)) * **util:** on_key compat with Neovim 0.9 ([effa885](effa885)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Did you check the docs?
Is your feature request related to a problem? Please describe.
No, just want to have some added functionality
Describe the solution you'd like
statuscol has a feature where an optional
cond
is passed to each section of the statuscolumn. Additionally, if possible, it would be nice to configure the amount of extra space between the signs and the normal contents of the buffer (between line numbers and buffer content)Describe alternatives you've considered
A
padding
value could help.Additional context
A big motivation for this change is to integrate nicely with neominimap.nvim. This is an awesome plugin, that uses that condition to make the mini map have a more compact look.
Thanks for the awesome plugin. You are the man.
The text was updated successfully, but these errors were encountered: