Modification of linum.el to provide relative line numbers for use with Viper-mode
Emacs Lisp
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


As it says in the description, this mode is basically linum-mode by Markus Triska, modified to provide relative line numbers. I called it relinum so it can coexist with normal linum-mode. I wasn't able to find a package that provided relative line numbers and since I like to use Viper and Vimpulse, I was sorely missing this feature. This is in fact even better than the Vim version, since it will number both windows that show the same buffer and will even work if you use follow-mode.


Currently there is one problem that depending on your taste could be minor or really annoying. If line-wrapping is turned on and the same buffer is viewed in 2 windows at the same time, sometimes the point jumps to the middle of the screen and the screen stays fixed instead of scrolling. For this reason I have decided to automatically turn off line wrapping if the mode is loaded.

If anyone has an idea why this happens or how to fix it, please send me a patch. In the past I have encountered this problem when using highlight-parentheses-mode.


To install, either clone this repository or download relinum.el, put it somewhere on your load path and add (require 'relinum) to your emacs config. You can load the mode via M-x relinum-mode or globally enable it via M-x global-relinum-mode.