Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs: globally enable whitespace-mode

I want globally enable whitespace-mode. I have tried this in my .emacs:

(require 'whitespace)
(setq-default whitespace-style '(face trailing lines empty indentation::space))
(setq-default whitespace-line-column 80)
(setq global-whitespace-mode 1)
(whitespace-mode 1)

but without success... I able to enable it via M+x whitespace-mode, but I want it to enable it globally... Any suggestions? I am using GNU Emacs 23.3.1 .

like image 335
Vladimir Mihailenco Avatar asked Jun 16 '11 21:06

Vladimir Mihailenco


1 Answers

In general it's best to enable/disable modes by using the function call, not setting the variable (which is what you did for global-whitespace-mode).

Try:

(global-whitespace-mode 1)
like image 115
Trey Jackson Avatar answered Sep 27 '22 22:09

Trey Jackson