Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable hl-line in Emacs when using Emacs Starter Kit?

Tags:

emacs

clojure

This problem is killing my productivity.

The Emacs Starter Kit automatically enables hl-line, which highlights the current line. It makes me unable to see the highlighting on the current line.

I've tried setting (global-hl-line-mode nil) and (hl-line-mode nil) globally and added to the mode hooks such as clojure-mode-hook, but it still shows up.

What elisp do I need to disable this feature?

like image 888
qrest Avatar asked Aug 23 '10 07:08

qrest


6 Answers

In starter kit 2 the corresponding hook to remove is:

(remove-hook 'prog-mode-hook 'esk-turn-on-hl-line-mode)

You'll need to add that to your own configuration after starter kit has initialised.

like image 98
Chris Lowis Avatar answered Nov 18 '22 16:11

Chris Lowis


hl-line-mode is turned on by the following line in starter-kit-defuns.el:

(add-hook 'coding-hook 'turn-on-hl-line-mode)

You can either comment out that line, or if you'd rather not touch the starter kit files, you can put the following in your personal init file at ~/.emacs.d/{username}.el:

(remove-hook 'coding-hook 'turn-on-hl-line-mode)
like image 26
incandenza Avatar answered Nov 18 '22 16:11

incandenza


I know this is an old question, but I recently had the same issue (using emacs 24) and found that it also can be solved simply by customizing the "hl-line" face:

  1. Do "M-x customize-face" and enter "hl-line".
  2. Customize to your liking and "save for future sessions".

If you turn off all attributes, you effectively disable the feature, at least from the user's point of view. For me, turning of the color highlighting and just setting "Weight" to "heavy" transformed hl-line from an annoyance to an unobtrusive, moderately useful feature.

like image 42
dhm Avatar answered Nov 18 '22 18:11

dhm


Try to place (global-hl-line-mode nil) at the bottom of your .emacs so no other command overwrites it.

like image 1
phimuemue Avatar answered Nov 18 '22 17:11

phimuemue


I don't think your problem came from ESK - it doesn't enable hl-line-mode. You'd have to have a line looking like (global-hl-line-mode t) somewhere if that were true. I'd suggest to simply search for that line in your config and and remove it if you find it. There are other highlighting modes as well. ESK automatically installs idle-highlight from ELPA - maybe this is what you mean. You can remove it by deleting it's entry from this piece of code in starter-kit-elpa.el:

(defvar starter-kit-packages (list 'idle-highlight
                                   'ruby-mode
                                   'inf-ruby
                                   'css-mode
                                   'yaml-mode
                                   'find-file-in-project
                                   'magit
                                   'gist)

You should also remove the downloaded package from ELPA's folder and restart Emacs.

like image 1
Bozhidar Batsov Avatar answered Nov 18 '22 16:11

Bozhidar Batsov


If you use ESK then the best place to put your own customizations is not .emacs but .emacs.d/{username}.el or .emacs.d/{username}/{username}.el.

like image 1
tbalazs Avatar answered Nov 18 '22 16:11

tbalazs