-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
feat(ui): add 'statuscolumn' option #20621
Conversation
619f71d
to
524e103
Compare
would it be possible to define a variable or sth so the cursorline number can be treated special? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming nit: based on existing options, I think 'numbercolumn' might be a more conventional name. That helps discoverability by grouping it with other "column" options.
Some comments from vim users and further consideration swayed me back to a
'statusline
' expression approach. We get things like highlighting, alignment, clickable elements(? untested) for free.
That's good info to include in the commit message.
Not sure it's necessary, can use |
524e103
to
86854ee
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
9902c8a
to
8a5ba34
Compare
Ready for another round of review. Points of contention are:
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
a3cdcee
to
283f67d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
283f67d
to
6c3741a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
6c3741a
to
668464f
Compare
Problem: Unable to customize the column next to a window ('gutter'). Solution: Add 'statuscolumn' option that follows the 'statusline' syntax, allowing to customize the status column. Also supporting the %@ click execute function label. Adds new items @C and @s which will print the fold and sign columns. Line numbers and signs can be clicked, highlighted, aligned, transformed, margined etc.
15f0d9d
to
2e4d0ea
Compare
Since it closed this, could i realy use this to set something between the linenumber and the code as it was asking? For example, set the GitSigns to be on this space instead of the extreme left of the window (as it were before)? |
Yes, IDK what "something" is but a margin between the line number and the code could be set like this:
If "something" is supposed to be the signcolumn, a more complete
Meaning foldcolumn -> line number -> right aligned sign column. Whether this should close that issue is still debatable I guess. |
That kinda did it, actually, wow. I just tried swapping the order and i tried: Which is almost like what i wanted, wow. I wanted: line number -> signcolumn -> foldcolumn and it's very close. Just have to get the number to 'sound' right (i mean the spacing and being aligned), and the relative numbers. Any tips on how to achieve that? |
Usage questions are better asked on Matrix or your discussion platform of choice. |
@luukvbaal fantastic work! Where did we land with these items:
Seems like a fine tradeoff. Can we close those 2 issues then? |
with neovim/neovim#20621 merged in it is now possible to fully customize the status-column in nvim (the column on the left containing line-numbers, fold info, signs and borders). A fair few cool implementations have popped up like: - https://github.com/CKolkey/config/blob/master/nvim/after/plugin/statuscolumn.lua - https://github.com/luukvbaal/statuscol.nvim - and my own personal one (based on CKolkey's fantastic work) https://git.hendrikpeter.net/hendrikpeter/pico-vim/-/blob/main/lua/peva/status_column.lua The problem with nvim-tree however is that dynamic sizing doesn't take the custom size of a status column into account and the end of file names get clipped off. This little patch should fix that (and give some examples to help other status_column modders get started). Thanks for looking at this and thanks for making this amazing plugin, I've been using it for a while and I really like it!
* fix: variable width accounts for sign/number columns * Add dynamic sizing padding options with neovim/neovim#20621 merged in it is now possible to fully customize the status-column in nvim (the column on the left containing line-numbers, fold info, signs and borders). A fair few cool implementations have popped up like: - https://github.com/CKolkey/config/blob/master/nvim/after/plugin/statuscolumn.lua - https://github.com/luukvbaal/statuscol.nvim - and my own personal one (based on CKolkey's fantastic work) https://git.hendrikpeter.net/hendrikpeter/pico-vim/-/blob/main/lua/peva/status_column.lua The problem with nvim-tree however is that dynamic sizing doesn't take the custom size of a status column into account and the end of file names get clipped off. This little patch should fix that (and give some examples to help other status_column modders get started). Thanks for looking at this and thanks for making this amazing plugin, I've been using it for a while and I really like it! * allow padding function, update docs, rollback readme * typo in example setup * help formatting --------- Co-authored-by: Alexander Courtis <[email protected]>
This comment was marked as resolved.
This comment was marked as resolved.
The default value is empty, meaning that it is not used. You should ask usage questions elsewhere, but the default "gutter" looks something like |
Problem: Unable to customize the column next to a window ('gutter').
Solution: Add 'statuscolumn' option that follows the 'statusline' syntax, allowing to customize the status column. Also supporting the
%@
click execute function label. Adds new items@C
and@s
which will print the fold and sign columns. Line numbers and signs can be clicked, highlighted, aligned, transformed, margined etc.Following discussion in #4941 (comment), this was ported/improved from vim/vim#11303, after it was rejected there.
Closes #6092, closes #19805, closes #20035.
A companion plugin to this option providing common number formats and click handlers is available here