Dimitar Panayotov shares experience

Everything which eases programmer’s life and satisfies the clients

GNU Emacs: Do not use tab character, use spaces!

Posted by Dimitar Panayotov on 29 November 2006, 2:25

Put this in your “.emacs” file:

(setq-default indent-tabs-mode nil)

If you want this setting to be per-file, use Emacs file-local variables like below. Remember: file-local Emacs variables MUST be in a comment section. It varies from language to language, you know.

-*- indent-tabs-mode: nil -*-
-*- indent-tabs-mode: t -*-

The first means “only spaces, please”, and the second — “use tabs, please”.
The alternative way of specifying Emacs local variables is (again, this should be in a comment section):

Local variables:
indent-tabs-mode: nil
End:

2 Responses to “GNU Emacs: Do not use tab character, use spaces!”

  1. GNU Emacs: Avoid huge indentations in Java « Dimitar Panayotov shares experience Says:

    [...] Comments (RSS) « GNU Emacs: Do not use tab character, use spaces! [...]

  2. Sharing painful experience » Blog Archive » GNU Emacs: Avoid huge indentations in Java Says:

    [...] tabs — see No tabs [...]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>