2

I have relative numbering turned on. There's no immediate way of telling which direction I want to move, however. For example, sometimes I see line number "7" and move 7j (7 lines down) when I really wanted to move 7k (7 lines up).

Is there a way to colour line numbers above the current line differently to line numbers below? This way I could very quickly determine whether I should move up or down.

I'm aware I could look at the surrounding numbers to determine the direction I should move, but colours convey meaning more quickly.

  • 1
    I'm guessing this isn't possible. Having trouble understanding how what you describe is a problem. Does your cursor line standout from other lines in any way? Because knowing where it is relative to a relative line number should be an instant tip-off as to whether 7j or 7k is the right choice. – B Layer Dec 25 '17 at 23:26
  • It does, but I've found I make this mistake sometimes. I would argue this means it's not as obvious (to me) which direction I should move as it could be. If I don't get an answer here I'll try making the cursor line stand out more- but having an especially contrasting cursor line could be quite unpleasant. – mkingston Dec 26 '17 at 16:04
  • Well, you could :set scrolloff=999 which will ensure the cursor line is always exactly in the middle of the window...then you'll know the right choice simply by whether the line in question is in the top half or bottom half of the window. ;) – B Layer Dec 26 '17 at 16:21
  • Hah! I'm, uh, not sure that's for me! – mkingston Dec 26 '17 at 16:44
  • :) Yeah, an extreme measure for sure though some people like it. Personally I just use set cursorline and have both 'number' and 'relativenumber' enabled and find that that nicely sets the cursor line + number apart (plus I like having absolute line number at the cursor line rather than "0"). A wise choice of colorscheme helps, too. Clearly you would like something more conspicuous, though. I'll keep it in mind and get back to you if I think of anything else. – B Layer Dec 26 '17 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.