Questions tagged [line-numbers]
81 questions
16
votes
3 answers
Permanently display line numbers in emacs
I am asking this after having read this post:
How do I display line numbers in emacs (not in the mode line)?
I have tried using:
M-x linum-mode
and
display-line-numbers-mode
After closing emacs and reopening, they are gone. Is there not a way to…

user1394
- 261
- 1
- 2
- 6
5
votes
1 answer
Absolute line numbers on the current and relative line numbers on all other lines?
I know this plugin for relative numbers, which works fine (with the option (global-relative-line-numbers-mode). I also know this elisp code, which gives me perfectly working absolute numbers:
(add-hook 'find-file-hook (lambda () (linum-mode…

uuu
- 303
- 2
- 15
5
votes
2 answers
Zero-indexed line numbering
I'm working with a file which is zero-indexed. Using M-x linum-mode, I can get emacs to display line numbers. How can I get emacs to start counting from 0 instead of 1?

shimao
- 163
- 5
4
votes
1 answer
Setting relative line numbers when in programming modes
Looking to set relative line numbers when in programming modes.
Looking through the older posts I see a way to set line numbers based on the mode - How do I display line numbers in emacs (not in the mode line)? :
@AnthonyB : (add-hook…

hicksca
- 43
- 5
3
votes
1 answer
Emacs 26 line numbers are ugly in empty buffers
I like that Emacs 26's line numbers are fast, but they seem to have a problem. If you open an empty buffer, there is an empty area which is reserved for line numbers:
Once you add some text onto that line, the empty area actually fills up with a…

GDP2
- 1,350
- 9
- 25
3
votes
2 answers
Emacs relative and absolute line number at the same time?
I don't mean hybrid line number mode, I want the absolute line number appears for all the lines, not only the current line number.

Luis Veliz
- 139
- 3
3
votes
1 answer
Setting width of relative-line-numbers
I am using the relative-line-numbers-mode and a 90 degree turned screen, which makes the text jump when it goes from displaying 100 in the relative number.
Is it possible to set a fixed width for the line numbers, i just need it set to 3…

DalekSall
- 333
- 2
- 10
2
votes
2 answers
Elisp program to insert line numbers into a buffer?
I am NOT looking for emacs's line-number mode. I don't want to just display line numbers. I want to insert line numbers in a buffer, starting at point and going to mark, or perhaps continuing for some number that I specify via C-u. For example,…

Reb.Cabin
- 721
- 6
- 19
2
votes
1 answer
How to get visual line-number-at-pos?
line-number-at-pos works fine when visual-line-mode is off.
But I can't find its equivalent for visual-line-mode.

abo-abo
- 14,113
- 1
- 30
- 43
2
votes
1 answer
What's the name of this relative line number package?
The relative line number style in url below would be very useful for me.
How can I replicate Vim's code folding?
This package shows the number of current position, not just 0.
Both sides of the current line shows relative numbers as usual.
I like…

cloudrain21
- 121
- 2
1
vote
1 answer
Position `display-line-numbers-mode` to the left when using `visual-fill-column-mode`?
I am very new to the world of Emacs and therefore I'd like to ask of everyone to be kind, not that I am expecting any flame or hate. (just a reminder)
I was recently recommended to use visual-fill-column-mode by someone in the Emacs matrix room…

Icy-Thought
- 11
- 2
1
vote
0 answers
Indicate line number thresold
How can I have a ruler displayed on a specific linenumber e.g. 20?
Similar to M-x ruler-mode though for lines/rows instead of columns

jjk
- 734
- 4
- 18
1
vote
1 answer
Add paragraph numbers
I have a longish document and I want to number the paragraphs.
So,
Here is the first paragraph. It could span multiple visual lines.
Two paragraphs are separated by an empty line.
converts to :
1 Here is the first paragraph. It could span multiple…

deshmukh
- 1,912
- 14
- 31
0
votes
0 answers
Relative numbers, bouncing text?
when I put relative numbers on, I get bouncing text when I move up an down.
I have short files where this is an issue, so it's not the number length. The entire line reshapes depending on the "width" of the number.
I tried a wider number column, but…

Vinn
- 293
- 2
- 8
0
votes
0 answers
How to separate line numbers from text when using global-display-line-numbers-mode?
Trying global-display-line-numbers-mode, I would like to achieve what linum-format does with:
Linum: Separating line numbers from text
How to achieve that using global-display-line-numbers-mode?

nephewtom
- 2,261
- 17
- 30