Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mark current line in emacs with some background color?

Is there a simply way to paint current line with some background color? Like it does hl-lock-line-face-buffer with regesp, but only the line wher point is.

edit: It is not smth like HIGHLIGHT-CURRENT-LINE, bacause i need to mark a line, then another line, and move point everywhere without affecting that highlights.

like image 861
Necto Avatar asked Oct 24 '25 14:10

Necto


1 Answers

The visible bookmarks (bm) package will do what you want. I set bm-highlight-style to bm-highlight-only-fringe for a marker in the column only, but if you want the whole line coloured then set it to bm-highlight-only-line:

(setq bm-highlight-style 'bm-highlight-only-line)

(global-set-key (kbd "<C-f2>") 'bm-toggle)
(global-set-key (kbd "<f2>") 'bm-next)
(global-set-key (kbd "<S-f2>") 'bm-previous)
like image 87
Ben Avatar answered Oct 26 '25 11:10

Ben



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!