sponsor Vim development Vim logo Vim Book Ad

RltvNmbr.vim : Display relative line numbers

 script karma  Rating 136/55, Downloaded by 3841  Comments, bugs, improvements  Vim wiki

created by
Charles Campbell
 
script type
utility
 
description
The RltvNmbr plugin uses the signs feature to display the line numbering relative to the current line.  A number of commands take [count] arguments for which this is helpful.

:RltvNmbr
    This command turns relative line numbering on.

:RltvNmbr!
    This command turns relative line numbering off.

CAVEAT:
    Your vim must have the signs feature compiled in!  This typically means that your vim has been configured and compiled to be "huge":
        configure --with-features=huge
        compile
        install

To check this:
:echo has("signs")
should show a "1".  Alternatively, look at the output of  :version  and see if you have +signs listed.

(alpha/beta version available at http://www.drchip.org/astronaut/vim/index.html#RLTVNMBR)
 
install details
vim RltvNmbr.vba.gz
:so %

(assuming you have vim 7.1 or later; with vim 7.0, you'll need to upgrade your vimball plugin)
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
RltvNmbr.vba.gz 3 2008-11-21 7.0 Charles Campbell * Speeded up sign unplacing
* Included g:rltvnmbrmode to report en/dis-ablement of relative numbering
* Includes some more autocmds for relative number updating
RltvNmbr.vba.gz 2 2008-08-20 7.0 Charles Campbell Been a number of requests to provide a toggling command, and so:  :RN  will toggle RltvNmbr'ing.  Plus a few more events will redraw the relative numbering signs.
RltvNmbr.vba.gz 1 2008-08-19 7.0 Charles Campbell Displays line numbers relative to the current line -- helpful with commands that use [count]s.
ip used for rating: 142.132.191.50

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github