Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show tabs with a different character (Emacs)

Tags:

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?

like image 440
elmarco Avatar asked Feb 20 '09 09:02

elmarco


People also ask

How do you add a tab character in Emacs?

To manually insert a tab in Emacs, use ctrl-Q TAB. control-Q causes the next key to be inserted rather than interpreted as a possible command.

How do I change tabs in Emacs?

To replace tabs with the appropriate number of spaces, use M-x untabify . To do the reverse and convert multiple spaces to tabs, you can use M-x tabify . Both commands work on a region. To run on the whole buffer use a prefix argument (i.e. C-u M-x untabify ).

How many spaces is a tab in Emacs?

This is because standard tabs are set to eight spaces. Tabs are special characters.


2 Answers

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

like image 120
danielpoe Avatar answered Sep 23 '22 05:09

danielpoe


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'.

like image 37
Jarekczek Avatar answered Sep 23 '22 05:09

Jarekczek