How to get relative line numbers in Eclipse

Relative line numbers in Eclipse
Relative line numbers in Eclipse

Being able to view relative line numbers in Vim makes it very easy to move around and operate in the editor. This is because a lot of Vim commands involve line counts that are relative to the current line.

If you are using Vrapper in Eclipse, you might be missing having relative line numbers. It is possible to get them by installing the Relative Number Ruler plugin.

Install

  • To install, go to Help -> Install New Software -> Add and use the URL http://matf.github.io/relativenumberruler/updatesite/

  • If you do not see any plugins show up, uncheck the “Group items by category” option at the bottom of the dialog.

  • You should be able to choose the plugin and install it from there.

Usage

20150521_relative_number_1

  • Right-click on the line number ruler, this is the editor column where the line numbers are displayed. From here, you can enable or disable both line numbers and relative line numbers.

  • If you would like to have the hybrid mode, where the current line shows the absolute line number and the rest show relative line numbers, that is supported too. Go to Window -> Preferences -> Relative Number Ruler and enable this feature.

Tried with: Relative Number Ruler 1.1, Eclipse 4.4.2 and Ubuntu 14.04

Advertisements

One thought on “How to get relative line numbers in Eclipse”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s