[vim/vim] Allow more alignment sections in statusline (Issue #11965)

11 views
Skip to first unread message

C.D. MacEachern

unread,
Feb 9, 2023, 10:05:12 AM2/9/23
to vim/vim, Subscribed

The feature has existed in Neovim since mid-2016: neovim/neovim#4489

I want to be able to use more than one %= in &statusline, rather than just one. My stl is quite minimal and I really enjoy just having the buffer name centered in the stl. I don't know if there's functionally any purpose, just an aesthetic preference.

Describe the solution you'd like
Allow any number of %= in &statusline rather than one. So that: set stl=left%=centered%=right centers the 'centered' string.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

screenshot of using it in neovim:

Screen Shot 2023-02-09 at 10 03 11 AM


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11965@github.com>

Bram Moolenaar

unread,
Feb 10, 2023, 10:53:36 AM2/10/23
to vim/vim, Subscribed


> The feature has existed in Neovim since mid-2016: https://github.com/neovim/neovim/pull/4489
>
> I want to be able to use more than one `%=` in `&statusline`, rather

> than just one. My stl is quite minimal and I really enjoy just having
> the buffer name centered in the stl. I don't know if there's
> functionally any purpose, just an aesthetic preference.
>
> **Describe the solution you'd like**

> Allow any number of `%=` in `&statusline` rather than one. So that:
> `set stl=left%=centered%=right` centers the 'centered' string.

Currently one %= item is supported, which allows for what follows to be
right-aligned. I think what you are asking for is for supporting two %=
items, which will be replaced by white space. What follows the second
%= will be right-aligned as before. The amount of white space is
computed so that the text between the two %= is centered.

This sounds useful. Perhaps someone wants to make a PR for this?

Supporting more than two %= does not appear to be useful. I would not
know how it can be useful.

--
hundred-and-one symptoms of being an internet addict:
109. You actually read -- and enjoy -- lists like this.

/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11965/1426006273@github.com>

C.D. MacEachern

unread,
Feb 10, 2023, 11:16:16 AM2/10/23
to vim/vim, Subscribed

I don't know how 3+ %= would be useful myself, I'd be happy with 2 :) I don't think I have enough knowledge to port what I need from the Neovim PR, so I'll leave this open so someone else could try.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11965/1426036061@github.com>

Yegappan Lakshmanan

unread,
Feb 10, 2023, 10:45:47 PM2/10/23
to vim...@googlegroups.com, reply+ACY5DGH4RGQPD7X453...@reply.github.com, vim/vim, Subscribed
Hi,

On Fri, Feb 10, 2023 at 8:16 AM C.D. MacEachern <vim-dev...@256bit.org> wrote:

I don't know how 3+ %= would be useful myself, I'd be happy with 2 :) I don't think I have enough knowledge to port what I need from the Neovim PR, so I'll leave this open so someone else could try.



I have created PR #11970 (https://github.com/vim/vim/pull/11970) to port this functionality.

- Yegappan
 

vim-dev ML

unread,
Feb 10, 2023, 10:46:01 PM2/10/23
to vim/vim, vim-dev ML, Your activity

Hi,

On Fri, Feb 10, 2023 at 8:16 AM C.D. MacEachern ***@***.***>

wrote:

> I don't know how 3+ %= would be useful myself, I'd be happy with 2 :) I
> don't think I have enough knowledge to port what I need from the Neovim PR,
> so I'll leave this open so someone else could try.
>
>
>
I have created PR #11970 (https://github.com/vim/vim/pull/11970) to port
this functionality.

- Yegappan


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11965/1426595503@github.com>

Bram Moolenaar

unread,
Feb 11, 2023, 6:15:50 AM2/11/23
to vim/vim, vim-dev ML, Comment

Closed #11965 as completed via 3ec78f9.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/issue/11965/issue_event/8496248813@github.com>

Reply all
Reply to author
Forward
0 new messages