How to view whitespaces in Emacs

Here’s how you can view whitespaces in Emacs:

M-x whitespace-mode RET

By default, Emacs uses bright colours to highlight whitespaces that are in wrong place (in Emacs’ opinion):

To disable colouring add the following to your .emacs file:

; disable colours in whitespace-mode
(setq whitespace-style '(space-mark tab-mark))

Now it’s much better:

I assign showing white spaces to Ctrl+Shift+8 to mimick Visual Studio behaviour:

(global-set-key (kbd "C-*") 'whitespace-mode)

Leave a Reply

Your email address will not be published.