Questions tagged [hl-line-mode]
29 questions
12
votes
1 answer
How to highlight current line only in selected window?
Q: is there a way to have hl-line-mode highlight the current line
only in the selected window?
When I have multiple windows showing buffers with hl-line-mode
on, it is difficult to tell, at a glance, which window is
current.
I have the variable…

Dan
- 32,584
- 6
- 98
- 168
11
votes
2 answers
Disable hl-line-mode only for eshell and ansi-term
I have global-hl-line-mode setup in my init file:
(use-package hl-line
:init (global-hl-line-mode 1))
Is it possible to disable it when I am in eshell and ansi-term?
I tried adding a hook like this:
(add-hook 'eshell-mode-hook (hl-line-mode…

Manuel Uberti
- 3,150
- 18
- 36
11
votes
3 answers
hl-line-mode hide background, how to avoid this?
With:
(when window-system
(set-face-background 'hl-line "light yellow")
(global-hl-line-mode 1))
current line highlighted by yellow background, but if text has background properties it also overwritten (like diff-mode, rainbow-mode).
Is it…

gavenkoa
- 3,352
- 19
- 36
9
votes
3 answers
Highlight current line without changing colours
I use (global-hl-line-mode 1) in order to highlight the current line.
This changes the text colours of the highlighted line. Is it possible to highlight while keeping the current syntax highlighting colours (so changing only the background)?

Nisba
- 895
- 8
- 19
6
votes
2 answers
hl-line face used as default in 26.1
When I use emacs 24.3.1 and run
/usr/bin/emacs -Q
Then M-< followed by M-xglobal-hl-line-mode and M-xdescribe-face, emacs asks me
Describe face (default `font-lock-comment-delimiter-face'):
But when I use 26.1 and run
/usr/local/bin/emacs -Q
and…

choroba
- 1,925
- 10
- 16
6
votes
2 answers
Enable hl-line-mode globally
Running M-x hl-line-mode enables highlighting for the current buffer.
How can i set highlighting current line to be enabled in init.el?
user12021
6
votes
1 answer
Combine highlight-symbol-mode and hl-line-mode
I want to highlight the current symbol under the cursor as well as the current line, but with different background colors.
Combining highlight-symbol-mode and hl-line-mode only highlights the entire line with the hl-line-mode color.
I have hl-line+…

Emil Vikström
- 223
- 1
- 6
4
votes
1 answer
How do I highlight the current line?
I am obviously not well versed in the world of Emacs so I was watching Casey Muratori's Emacs video and whenever he traversed any file in Emacs, the current line always had a different background color to the rest of the file. I want that because…

Eyad H.
- 143
- 5
4
votes
0 answers
How to keep hl-line updated in inactive window?
I have (setq global-hl-line-sticky-flag t) to enable hl-line in all windows. However, the highlighted line isn't updated when I change the cursor position in inactive window (e.g., by calling next-error to go to next error in the compilation…

AhLeung
- 1,083
- 5
- 14
4
votes
1 answer
How can I eliminate the side effect of left margin?
I've set a left margin like this:
(set-window-margins (get-buffer-window) 20 0)
(let ((gutter-sep (concat (make-string (- (car (window-margins (get-buffer-window))) 2) ? ) "+")))
(propertize "." 'display `((margin left-margin) ,gutter-sep)…

Amos
- 456
- 3
- 11
3
votes
2 answers
Disable hl-line-mode at startup
Something turned hl-line-mode on, which is painful to look at with my color theme.
I've added this to my .emacs
(hl-line-mode -1)
(global-hl-line-mode -1)
to no avail.
I've tried commenting out everything in my .emacs, but the highlighting still…

cangrejo
- 131
- 4
3
votes
1 answer
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 course that works really bad when I change my…

jbssm
- 233
- 2
- 7
2
votes
2 answers
Highlight current line in org-agenda
Running Doom Emacs v2.0.9 on Emacs 27.1.
In the agenda buffer, how do I get the current line highlighted?
global-hl-line-mode is enabled and the current line in other buffers is highlighted as expected.
However, agenda buffer does not show this…

deshmukh
- 1,852
- 13
- 29
2
votes
1 answer
Why is hl-line+.el not a package?
Apparently hl-line+.el solves certain performance problems of hl-line-mode.
It is created in 2006, and last updated in 2018.
Despite that, it was never packaged to be available at e.g. melpa, which would be a bit more convenient than copy-pasting…

9000
- 497
- 2
- 15
2
votes
2 answers
Highlight current line in GUD disassembler window
I am using GUD for debugging C code. Because many of the lines and variables have been optimized away, it is necessary to follow the C source and the corresponding disassembly simultaneously. I want the current line in the disassembler window to be…

nispio
- 8,175
- 2
- 35
- 73