Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to always turn off hl-line-mode, i.e., globally

Tags:

emacs

I use Cocoa Emacs 23.1.91 and I want to always have hl-line-mode turned off as I don't like using it. I can turn it off per buffer via M-x hl-line-mode, but that is tedious. Any help is appreciated!

Thanks

like image 407
m7d Avatar asked Mar 26 '10 20:03

m7d


3 Answers

if you are having this enabled by the mode (I'm pretty sure you would have to request it explicitly) you can always add this to your .emacs

(add-hook 'ruby-mode-hook
  (lambda()
    (hl-line-mode -1)
    (global-hl-line-mode -1))
  't
)

as the last line of config. 't is important as it will tell emacs to append this hook at the end of all hooks for the mode

like image 191
radekg Avatar answered Oct 13 '22 18:10

radekg


If you want to have it always disabled it's probably best to add this line to your .emacs:

(global-hl-line-mode -1)
like image 22
Bozhidar Batsov Avatar answered Oct 13 '22 18:10

Bozhidar Batsov


M-x global-hl-line-mode


doc:

global-hl-line-mode is an interactive compiled Lisp function in `hl-line.el'. (global-hl-line-mode &optional ARG)

Global minor mode to highlight the line about point in the current window. With ARG, turn Global-Hl-Line mode on if ARG is positive, off otherwise.

Global-Hl-Line mode uses the functions global-hl-line-unhighlight' and global-hl-line-highlight' on pre-command-hook' andpost-command-hook'.

like image 41
Tuomas Pelkonen Avatar answered Oct 13 '22 18:10

Tuomas Pelkonen