Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [hl-line-mode]

The tag has no usage guidance.

4
votes
2answers
93 views

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 ...
2
votes
2answers
45 views

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 ...
0
votes
1answer
43 views

How to change setting for all modes except one?

How can I chance an Emacs config setting (let's say "highlighting of current line") that I set in .emacs as (global-hl-line-mode +1), to work for all modes except one. For example, I want ...
0
votes
0answers
22 views

Coloring logfiles interactively [duplicate]

When reading logfiles I like to call highlight-regexp interactively to mark points of interest. However I also do have hl-line-mode enabled (via global-hl-line-mode). I get different behaviour here ...
3
votes
0answers
66 views

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-...
0
votes
0answers
81 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 ...
2
votes
0answers
72 views

How can I make hl-line mode not override the color of rainbow-mode? [duplicate]

Is there an non-intrusive way to do this? I've made a fork of rainbow-mode that uses overlay instead of text properties, which solves this :) https://github.com/amosbird/rainbow-mode
3
votes
1answer
190 views

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 "." '...
1
vote
2answers
200 views

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 ...
0
votes
1answer
37 views

How to account for tabs in `hl-line-range-function`?

To avoid conflicts with highlighting indentation, I made the highlight line begin after the current indentation. This works well, except when tabs are used as leading white space. How could the my-...
2
votes
1answer
130 views

Automatically turn on hl-line-mode inside org-mode tables

Based on this answer my question is whether there is a (simple) way to automatically turn on hl-line-mode whenever the cursor is within an org-mode table in an org-mode file. I tried to find a hook ...
0
votes
1answer
95 views

Setting hl-line-mode for programming modes

In my init file I have this: (add-hook 'prog-mode-hook (lambda () (linum-mode 1))) So it shows line numbers only for programming modes. I tried to do the same with hl-line-mode, but it does not work:...
6
votes
2answers
1k views

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 ...
1
vote
0answers
173 views

Can I override global-hl-line-mode in a buffer/window?

I have the following line turning hl-line-mode on globally in my init file: (global-hl-line-mode) Most of the time, that's how I like it. But sometimes I want to turn it off. I'd hoped that I could ...
5
votes
2answers
2k views

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?
0
votes
1answer
161 views

Eval-buffer works, init does not hl-line fix

I have written the following bit of emacs lisp that allows hl-line to extend past end of buffer to the rest of the line. Problem is, this only works if I use (eval-buffer) after start-up and not when ...
5
votes
1answer
473 views

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 ...
3
votes
1answer
2k 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 ...
12
votes
1answer
1k views

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 ...
2
votes
1answer
67 views

Highlight a single line in a long word-wrapped line

I want to have a single line in a long-word wrapped line highlighted. The default setting of hl-line seems to highlight the whole wrapped line as shown below. Which setting do I have to change to ...
9
votes
3answers
972 views

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 ...
6
votes
2answers
821 views

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 ...