Emacs relative+current number line

by Student   Last Updated August 14, 2019 15:01 PM

I just switched from vim to emacs :) happily using evil mode and the first problem I have is the lack of (column) relative number functionality.

No problem, I found two threads that halfly resolved:

It now shows relative number. However, I hope two things can be improved.

1. Now the line my cursor is at is noted as the "0"-th line. I hope it can instead shows which line the cursor is at.

Pictorially, it is now:

-2 |
-1 |
0  |     < my cursor >
1  |
2  |

and what I hope for is (given that I am at the 377th line)

-2 |
-1 |
377|     < my cursor >
1  |
2  |

2. When the blocks of my code are folded, the functionality tells me the "absolute" relative number:

-37| < a folded block of codes >
-3 | < another folded block of codes >
0  | < my cursor >
19 | < yet another folded block of codes >
53 | < yet yet .. >

However, this has the draw back that I cannot easily press 2k to move to the "-37"-th line, since I have to count carefully before doing that. Is there a neat solution that gives the following?

-2|-37| < a folded block of codes >
-1|-3 | < another folded block of codes >
0 |377| < my cursor >
1 |19 | < yet another folded block of codes >
2 |53 | < yet yet .. >

Thank you very much in advance. Please let me know if I miss some thing / can express myself more clearly.

Tags : vim emacs packages


Related Questions


Cannot load the paradox package in Emacs

Updated January 10, 2019 20:01 PM

How can I show vertical indentations markers with Emacs?

Updated September 29, 2018 16:01 PM

How to use tensorflowsharp in c#

Updated January 20, 2019 13:01 PM