1

I'm looking for a way to display hidden characters like newline and tab characters in emacs. I am NOT trying to convert the characters, just display them in the current buffer.

In vi(m), I can do this with the :set list command. Additionally, I can customize the appearance of the characters something like this:

set listchars=tab:▸\ ,eol:¬

This makes it easy to see tabs and where new lines start. I desperately need this feature in emacs as well, can someone provide it? Many thanks.

6

Try M-x whitespace-mode to toggle display of space, line breaks, etc. You can set whitespace-style to control what gets displayed. (Try M-x customize-variable whitespace-style to see what options are available.)

You might also try: M-x customize-group whitespace, to see all the related options -- whether to turn on whitespace-mode globally, how to display each kind of whitespace, etc.

2

@glucas gave the standard answer for this question: Vanilla Emacs provides whitespace-mode out of the box.

EmacsWiki page ShowWhiteSpace describes some other approaches, one of which is library highlight-chars.el.

You can use highlight-chars.el to easily highlight any sets of characters that you choose, including whitespace characters. There are commands and functions to use on hooks.

You can highlight whitespace and other easily confused characters: spaces, tabs, hard spaces, and hard hyphens, as well as trailing whitespace.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.