Emacs hl-line mode

Share on:

I find it useful to have the line where the cursor is highlighted for certain Emacs modes.

Its quite easy:

(require 'hl-line)

(add-hook 'package-menu-mode-hook 'hl-line-mode)
(add-hook 'gnus-group-mode-hook 'hl-line-mode)
(add-hook 'gnus-summary-mode-hook 'hl-line-mode)
(add-hook 'org-agenda-mode-hook 'hl-line-mode)
(add-hook 'dired-mode-hook 'hl-line-mode)

I used highline.el for this in the past, but it stopped working for some reason, so I switched to hl-line.el. hl-line.el is included in Emacs proper.