10

I have set nu in my .vimrc which shows line numbers on the left side of current buffer. I would like to see line numbers on the right side. How to achieve this?

UPDATE: This should also work for set relativenumber

  • This would make no sense unless your text was right justified... – jasonwryan Dec 18 '14 at 18:04
2

There's no way, unless you switch the complete UI to right-left mode via :set rightleft or $ vim -H. Even common workarounds such as using the signs column (which a plugin used to implement 'relativenumber' before that was built-in) won't do, as those appear on the left as well. The only, very clumsy hack would be a thin scratch buffer in a vertical split on the right, but updating that and maintaining the rightmost position will be a royal pain.

I don't know how hard it would be to modify the source code to do this, but I guess it isn't trivial, and Bram is unlikely to accept such a patch. So, better get over it, sorry.

1

VIM's Hebrew Mode will put the line numbers on the right, with set nu

To start VIM in Hebrew Mode use vim -H

Documentation here

Warning: It does reverse your text to rightleft as well

  • 4
    Ford's "UK mode" will put the steering wheel on the right. Warning: it does roll the entire car onto its back. – John P Dec 13 '17 at 8:49

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.