[vim/vim] Align right current line number when `set nu rnu` (Issue #9847)

69 views
Skip to first unread message

Maxim Kim

unread,
Feb 25, 2022, 9:24:10 AM2/25/22
to vim/vim, Subscribed

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.

It would be nice if there were a way to have current line number aligned right when set number relativenumber is active:

image

Describe the solution you'd like
A setting, like set relativenumberopt=right that aligns current relativenumber line right.


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/9847@github.com>

Christian Brabandt

unread,
Feb 25, 2022, 9:27:37 AM2/25/22
to vim/vim, Subscribed

I think this is a duplicate of #1875, #680 and possibly #1368


Reply to this email directly, view it on GitHub, or unsubscribe.


Triage notifications on the go with GitHub Mobile for iOS or Android.

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

Maxim Kim

unread,
Feb 25, 2022, 9:29:51 AM2/25/22
to vim/vim, Subscribed

True, didn't search it properly


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

Christian Brabandt

unread,
Feb 25, 2022, 9:34:35 AM2/25/22
to vim/vim, Subscribed

I think the reason for the left-alignment was, that it would look confusing for a file with 3 lines:

  1  cursorline
  1  1 line before the cursor
  2  2nd line after cursor

Which looks strange, so we made the decision to left align it to make it stand out more.

But now we have highlighting groups LineNr, LineNrAbove and LineNrBelow so perhaps it's time to revisit this decision ?


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

Maxim Kim

unread,
Feb 25, 2022, 9:37:43 AM2/25/22
to vim/vim, Subscribed

Do you think about option or change of the current default alignment to what set rnu has?

image


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

Christian Brabandt

unread,
Feb 25, 2022, 9:39:45 AM2/25/22
to vim/vim, Subscribed

Personally, I don't want another option for such a small change. But this would be a backwards-incompatible change, so not sure


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

Maxim Kim

unread,
Feb 25, 2022, 9:58:39 AM2/25/22
to vim/vim, Subscribed

So I have removed a single line:

https://github.com/vim/vim/blob/4d56b971cbae01cc454eb09713326224993e38ed/src/drawscreen.c#L1227

and it "works":

image


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

vim-dev ML

unread,
Feb 25, 2022, 10:06:34 AM2/25/22
to vim/vim, vim-dev ML, Your activity


On Fr, 25 Feb 2022, Maxim Kim wrote:

> So I have removed a single line:
>
> https://github.com/vim/vim/blob/4d56b971cbae01cc454eb09713326224993e38ed/src/drawscreen.c#L1227

There should be a similar line in drawline.c which you also need to
change:

https://github.com/vim/vim/blob/master/src/drawline.c#L1150


Best,
Chris
--
Die Menge glaubt, alles zu wissen und alles zu begreifen. Je dümmer
sie ist, um so weiter ist der Horizont, den sie zu haben vorgibt.
-- Anton Pawlowitsch Tschechow


Reply to this email directly, view it on GitHub, or unsubscribe.


Triage notifications on the go with GitHub Mobile for iOS or Android.

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

Maxim Kim

unread,
Feb 25, 2022, 10:20:45 AM2/25/22
to vim/vim, vim-dev ML, Comment

There should be a similar line in drawline.c which you also need to
change:

Yes, indeed:
image

Do you think it makes sense to PR it?


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you commented.Message ID: <vim/vim/issues/9847/1050945272@github.com>

Bram Moolenaar

unread,
Feb 25, 2022, 10:58:18 AM2/25/22
to vim/vim, vim-dev ML, Comment

When not using clearly different highlighting, near the start of the file, with wrapping lines, it becomes very hard to spot the line number. Maybe it doesn't look nice left aligned, but it is functional.


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you commented.Message ID: <vim/vim/issues/9847/1050976673@github.com>

Bram Moolenaar

unread,
Feb 25, 2022, 3:00:53 PM2/25/22
to vim/vim, vim-dev ML, Comment


> > When not using clearly different highlighting, near the start of the
> > file, with wrapping lines, it becomes very hard to spot the line
> > number. Maybe it doesn't look nice left aligned, but it is functional.
>
> That is true. And an option is not an option here?

'rightaligncursorlinenumber' ?

--
hundred-and-one symptoms of being an internet addict:
99. The hum of a cooling fan and the click of keys is comforting to you.

/// 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.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you commented.Message ID: <vim/vim/issues/9847/1051184289@github.com>

Maxim Kim

unread,
Feb 26, 2022, 1:06:35 AM2/26/22
to vim/vim, vim-dev ML, Comment

'rightaligncursorlinenumber' ?

Indeed, it doesn't look and sound very good.

I can live without it.


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you commented.Message ID: <vim/vim/issues/9847/1051653492@github.com>

Maxim Kim

unread,
Feb 26, 2022, 1:06:36 AM2/26/22
to vim/vim, vim-dev ML, Comment

Closed #9847.


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

Imran ZERO

unread,
Feb 27, 2022, 6:45:31 AM2/27/22
to vim_dev
Unrelated. But what is the colorscheme you are using?

Maxim Kim

unread,
Feb 27, 2022, 7:08:59 AM2/27/22
to vim_dev
Experimental one(s): https://github.com/habamax/.vim/tree/master/pack/local/start/vim-monk/colors

воскресенье, 27 февраля 2022 г. в 14:45:31 UTC+3, imran...@gmail.com:

Felix Green

unread,
Jul 17, 2025, 12:54:09 PM7/17/25
to vim/vim, vim-dev ML, Comment
felixakiragreen left a comment (vim/vim#9847)

it's not complete! I can't live like this.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/issues/9847/3084758417@github.com>

Reply all
Reply to author
Forward
0 new messages