Questions tagged [linum-mode]

for line numbering modes, such as `linum-mode` and `line-number-mode` minor modes that show line numbers on the left screen edge for ease of editing and navigating. They do not insert line numbers in the file. `line-number-mode` also has a `column-number-mode`, which shows in the mode line.

Filter by
Sorted by
Tagged with
11 votes
1 answer
2k views

What to use instead of linum-mode in Emacs 29?

It seems that Emacs 29.1 has deprecated linum-mode. I haven't found a replacement yet. On ELPA I see nlinum-mode, but that seems to use linum, too. So what is the official replacement?
A Schmitz's user avatar
  • 113
0 votes
1 answer
210 views

Remove color overlay from active line with `display-line-numbers-mode`

Since linum-mode is replaced with display-line-numbers-mode I'm having an color overlay on the active line, seen in this screenshot as white on the line 77: Tried to change the theme and few other ...
Djole's user avatar
  • 25
0 votes
0 answers
40 views

How to discard line-number highlight during i-search?

During the i-search if I use dracula theme it highlights the line-number if the searched word is the first in the line. Example view: If I uncomment (load-theme 'dracula t) the example view would be ...
alper's user avatar
  • 1,370
0 votes
0 answers
285 views

How can I disable line numbers on empty lines?

I find it easier to visualize double line breaks if there's actually blank space between paragraphs. I never need to see the line number of a blank line, but I do really like seeing a line number when ...
Oliver Richardson's user avatar
1 vote
1 answer
53 views

How to enable linum-mode only during I-search?

linum-line it not enabled when emacs is started. I just want to enable linum-mode (see the line numbers) during I-search and disable it when I-search: is ended. Is it possible?
alper's user avatar
  • 1,370
2 votes
1 answer
325 views

Does anyone know of a quick method to get hexadecimal line numbers in emacs?

Does anyone know of a quick method to get hexadecimal line numbers in emacs? I am using linum for line numbers. I suppose I could hack it, but just thought to ask first.
Roadowl's user avatar
  • 131
0 votes
2 answers
1k views

How to add some space to the left of the line numbers in linum-mode?

When I enable linum-mode in the scratch buffer (and most other buffers I tried) there is no space to the left of the line numbers. Although when enable linum-mode in the .emacs configuration file, I ...
scribe's user avatar
  • 1,035
1 vote
1 answer
176 views

How to downscale linum font size (and avoid left margin gap)?

I need your help cause I couldn't figure it out. My ideal linum format has 5 digits at least. I'd really like to scale the linum font size down with respect to the text, say by 1/3. This is great ...
desmogix's user avatar
0 votes
1 answer
198 views

I can turn on minor modes like electric pair modes in my init, but they’re not having effect unless manually reactivated [duplicate]

So I can put a line like, (setq-default global-linum-mode t) or (setq-default electric-par-mode t) in my init file, and I can check with C-h v that the variables are in fact set to t (they are), but ...
cryptograthor's user avatar
8 votes
1 answer
5k views

How to change line-number gutter width using display-line-numbers mode?

I am using (global-display-line-numbers-mode 1) in my init.el file and everything is working as expected. The only problem is that I find the gutter width to be too wide and would prefer it to match ...
dylanjm's user avatar
  • 323
4 votes
1 answer
869 views

Line numbering: stick with linum or nlinum? [closed]

I see that both linum and nlinum are actively maintained: one is built-in, another recently had a release. With older Emacs version, linum used to be slow with a lot of folding in a buffer (e.g. in ...
9000's user avatar
  • 537
0 votes
1 answer
157 views

auto-start of linum mode doesn't work

I'm currently using spacemacs. I have put the line (global-linum-mode t) into the .spacemacs file but it doesn't work at all. It used to work when I used the normal emacs. I don't have any clue of ...
user avatar
4 votes
1 answer
728 views

Bent arrow (↩) in visual-line-mode

I would like to see a bent arrow (↩) in the window fringe, when I'm using visual-line-mode becuse with no linum-mode (e.g. org, md, latex..) I'm not able to distinguish the lines. References: ...
Francesco Cadei's user avatar
3 votes
2 answers
265 views

Elisp - Activate and Deactivate Linum-Mode when Goto-Line is Triggered

I switched to Emacs from Vim and because of Vims functionality of giving keys a prefix, (for example to jump up several lines etc.) i installed relative-linum-mode right away. Now i found out about ...
Tim Hilt's user avatar
  • 297
0 votes
1 answer
170 views

is it possible to set linum-mode at startup of buffer?

I wonder if it is possible to set #+STARTUP: linum-mode t or similar at the start of the buffer (not interested in the global mode). I have tried this but it won't work. Any solution? Thanks!
Emmanuel Goldstein's user avatar
0 votes
0 answers
337 views

term without line numbers and highlight for current line

I have the following settings in ~/.emacs: (setq linum-relative-current-symbol "") (linum-mode) (linum-relative-global-mode) (global-hl-line-mode t) In order to supress both these features in ...
deshmukh's user avatar
  • 1,912
2 votes
0 answers
3k views

Show both relative and absolute line numbers in Emacs 26

One of the new features in Emacs 26 is display-line-numbers-mode: Emacs now supports optional display of line numbers in the buffer. This is similar to what linum-mode provides, but much faster and ...
izkon's user avatar
  • 1,878
1 vote
0 answers
215 views

linum-off for nlinum

Many people are advertising nlinum over linum. I had a configuration for linum copied from the linum-off.el script you can find on internet: (require 'linum) (defcustom linum-disabled-modes-list '(...
Louis Roché's user avatar
1 vote
1 answer
1k views

How to add right padding to the current line number in emacs in nlinum-mode

I'd like to make current line number in relative line number mode more distinguishable (setq nlinum-format-function 'myformat) (defun myformat (line width) (if (eq line (what-line)) "123 " ...
user1685095's user avatar
2 votes
0 answers
151 views

hide-show with linum

When working on huge files, it seems that when hide-show collapses a large multi-line block, linum still creates hidden overlays for every line in the hidden block leading to unresponsive emacs. Is ...
Tohiko's user avatar
  • 1,649
2 votes
1 answer
173 views

Can linum-relative disregard folding?

Is it possible to have linum-relative disregard folding? The default works poorly with evil <count>j/k-jumping and ex-commands such as -13t. in org mode. (To comments: I said 'screen lines' ...
Toothrot's user avatar
  • 3,264
2 votes
1 answer
514 views

Centered text with line numbering

Writeroom mode and linum mode are incompatible (leave numbers at far left, making them useless for (evil) jumping). Is there anything else I can do to get centered text with (relative) line numbering ...
Toothrot's user avatar
  • 3,264
0 votes
1 answer
37 views

linum referring to the top of the window

I use the "go to line" navigation a lot, but mostly of the time I have to type a three digit number in order to navigate through the document. I would like to have a row count referring to the ...
Nisba's user avatar
  • 905
1 vote
1 answer
844 views

linum-mode not working in OSX built in emacs version 22.1.1

I'm running emacs through my terminal on OSX and was trying to get my line numbers on here. Ran the command M-x linum-mode with a [No match] result. Tried global-linum-mode, same result. emacs --...
Jaken's user avatar
  • 113
4 votes
1 answer
770 views

How can I move by screen lines as quickly as forward-line?

next-line is very slow, and this is creating problems. I'll give some background then explain why. By default, linum.el treats a wrapped line as a single line, and it takes into account hidden lines ...
JCC's user avatar
  • 1,029
1 vote
0 answers
128 views

Unexpected "secondary" line number labels in org-mode

In .org files—I've seen it only in a file with over 1k lines—emacs sometimes displays a secondary "line number" next to certain headings, like so: The left-most gutter is populated by linum+, but the ...
Henry's user avatar
  • 203
0 votes
3 answers
993 views

How to have both fixed linum and relative linum?

I installed linum relative with this. But installing this replaced my fixed linum. I want to have both fixed line number and relative line number as well. How can I do this?
Ansuman Bebarta's user avatar
4 votes
0 answers
421 views

"Invalid face reference: linum" even load linum after make frame

I want to have line number at buffer, but when I use Emacs server, the Message buffer display the following error: Invalid face reference: font-lock-comment-delimiter-face [2 times] Invalid face ...
astroboylrx's user avatar
2 votes
3 answers
2k views

Enable Linum Mode for all files (with extension) but not other buffers?

In my init.el file I have the following line: (global-linum-mode 1). I want linum-mode enabled for every file, but not for other buffers. I.e. Is there a way to enable linum mode globally for all ...
Startec's user avatar
  • 1,344
6 votes
1 answer
984 views

Line number (linum, nlinum) grow margin with increase in font size

When I turn on linum-mode or nlinum-modeand increase the font size via C-x C-+ it does not increase the size of the "margin" where the line number is displayed, so only part of the line number is ...
Greg Nisbet's user avatar
4 votes
0 answers
114 views

using global-linum-mode with ess with a latex/R knit file

When using global-linum-mode with a latex file that has blocks of R code (*.rnw file) moving in and out of the R code blocks cause the line numbers to disappear until the cursor is moved again. Is ...
mjb's user avatar
  • 91
3 votes
2 answers
4k views

Adding padding to the left of text in buffer

I have been looking around for some fix for this but I cannot google-fu my way out of it. I have tried setting the fringe, but that doesn't seem to work. Right now I have the code (unless (bound-and-...
Steei's user avatar
  • 33
3 votes
1 answer
3k views

Changing the background of line number column (linum) to the same color of line highlighting background color

Is there a way to set the background color of the line numbering to the same color of the line highlighting background color? So far I have to put the line numbering background color manually and of ...
jbssm's user avatar
  • 233
3 votes
0 answers
512 views

Turning relative numbering on (with linum-relative) in Spacemacs only when in normal mode

In Vim I have relative numbering which is turned on most of the time but it's turned off when in insert mode or when the window losses focus (both when changing to another Vim window or when changing ...
jbssm's user avatar
  • 233
1 vote
0 answers
489 views

Right aligned relative numbering with separator space in Spacemacs using linum-relative

I've been using Vim for a while and now I've discovered Spacemacs and I found it great how it blends Vim ease of editing with Emacs superior power. I really loved some parts of my Vim config, one of ...
jbssm's user avatar
  • 233
1 vote
0 answers
996 views

autocomplete popup menu broken emacs 24.5.1

I have recently encountered a problem with autocomplete when used together with linum. When I turn on the global-linum-mode, the emacs only shows part of the popped-up menu of candidates correctly. ...
river_06's user avatar
2 votes
2 answers
4k views

How to disable global Linum mode for certain mode?

in my init.el file I have the following: (global-linum-mode 1) (add-hook 'term-mode-hook (lambda () (linum-mode))) However, when I enter ansi-term-mode linum mode is still on. I have also tried (...
Startec's user avatar
  • 1,344
1 vote
0 answers
222 views

helm-M-x and linum-relative

I use the linum-relative package to get line numbers relative to the cursor in the margin. The reason this is useful to me is I drive emacs with speech recognition, and the speech recognizer has a ...
Joseph Garvin's user avatar
3 votes
0 answers
115 views

How to hide the extra period in linum mode when you have whitespace mode enabled?

I have linum mode and whitespace mode enabled. This works great except that I want padding in linum mode (which uses a space) and so, instead of there being a space (or a different colored space as I ...
Startec's user avatar
  • 1,344
5 votes
1 answer
5k views

How do I run a function on start-up?

How do I run an arbitrary function upon starting up Emacs? My specific problem: in spacemacs, I have added the following to the config section of my .spacemacs file: (add-hook 'evil-insert-state-...
Running Turtle's user avatar
2 votes
1 answer
2k views

How to make a solid line seperator in linum mode? [duplicate]

I want to have a solid line seperating the line numbers from the text in linum mode. I have tried following this guide and have this code in my .emacs http://www.emacswiki.org/emacs/LineNumbers#toc8 ...
Mohamed Abdelkhalek's user avatar
2 votes
2 answers
5k views

How to configure linum-mode in spacemacs?

How can I configure spacemacs to always have linum-mode active in C/C++ buffers (cc-mode)?
Roskoto's user avatar
  • 123
7 votes
3 answers
2k views

where are emacs lisp files?

I'm trying to add line numbers to emacs, following this guide: Linum: Separating line numbers from text. I have to edit "linum.el" to add some code, however I can't find that file. I'm using ubuntu, ...
user5133's user avatar
7 votes
2 answers
3k views

Any way to get a working separator line between fringe/line numbers and the buffer?

is there any way to get a separator like the one for the split buffers (line in the middle of the image) for the line numbers/fringe? I tried (setq linenum-format "%4d \u2502 ") but that gives me a ...
nemesit's user avatar
  • 291
0 votes
1 answer
706 views

Non-existent line numbers flickering

I have written till the 35th line in Emacs with activated line numbers (so my last line number is 35). When I am writing in the 32nd line there are line numbers flickering up to the 43rd line number (...
Adam's user avatar
  • 2,447
7 votes
1 answer
379 views

Problem with line number limit in linum-mode

I am using the term of Emacs to compile some code, with linum-mode enabled to display the line numbers for the terminal, and the line numbers stop increasing as soon as they reach 2049. If I write ...
Adam's user avatar
  • 2,447
5 votes
1 answer
222 views

Confusion with line numbers

When I enable line numbers in Emacs the cursor starts in a line with no number in it. If you press enter then the numbers increment but always there is a line with no number. Why is that happening?
Adam's user avatar
  • 2,447
9 votes
2 answers
2k views

How can I fill the entire line number bar with a custom background color?

In the screenshot below I have simply set the background of the linum face to some color, however there is a blank region at the end of the buffer and there are gaps between the lines when line ...
Lenar Hoyt's user avatar
  • 1,173
72 votes
9 answers
83k views

How do I display line numbers in emacs (not in the mode line)?

I know how to display line numbers (and columns) in the mode-line, but I'd like emacs to display the line numbers for all the lines on the left-hand side. I've seen this done in vim and other text ...
programking's user avatar
  • 7,194