Show tabs with a different character (Emacs)

2019-02-01 09:22发布

问题:

I'd be happy to have very soft character ">>" instead of white-space, like this:

Mono develop http://primates.ximian.com/~miguel/pictures/Valabinding-classpad.png

How can I achieve that in Emacs?

回答1:

EDIT: Just realized that blank-mode is superseded by whitespace. Load this and customize whitespace-style to at least contain tabs and tabs-mark. I currently have:

(setq whitespace-style '(trailing tabs newline tab-mark newline-mark))

There is also blank-mode which allows you to achive what you want and it gives you some nice functions to cleanup the whitespace to your likings: http://www.emacswiki.org/emacs/BlankMode



回答2:

On my Emacs version (24.3) no additional modules are needed. It's enough to launch

M-x whitespace-mode

To customize go to whitespace-style variable help,

C-h C-h v whitespace-style

This mode has many functionalities. To made it simpler one may choose not to use `Face visualization'.



回答3:

Use "M-:" (M-x eval-expression) and enter the following expression:

(let ((d (make-display-table)))
  (aset d 9 (vector ?> ?>))
  (set-window-display-table nil d))

To get back to normal enter:

(set-window-display-table nil nil)


回答4:

Google search brought up show whitespace-mode. Haven't tried it myself.