Search code examples
emacsbookmarks

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.


Solution

  • 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)