up vote 3 down vote favorite
share [g+] share [fb]

How can I configure emacs so that when I press the the Tab key it inserts spaces?

link|improve this question

65% accept rate
@Eight - not sure this is a "find and replace" issue. It could be simply asking how to make "tab" produce spaces, from now on. – Gnoupi Feb 16 '10 at 14:48
There's probably a better tag to go along with emacs here. @gno – random Feb 16 '10 at 14:58
yes, this isn't find and replace. I want tab to produce spaces :) – Zubair Feb 16 '10 at 15:09
feedback

1 Answer

up vote 10 down vote accepted

To configure Emacs so that pressing Tab will produce spaces instead of actual tab characters:

M-x set-variable<RET> indent-tabs-mode<RET> nil

Or in your .emacs file:

(setq-default indent-tabs-mode nil)

From this page.

link|improve this answer
(setq-default indent-tabs-mode nil) worked!!!! – Zubair Feb 16 '10 at 16:26
Note that there's more to this than meets the eye in Emacs. See emacswiki.org/emacs/CategoryIndentation for details. – phils Jul 1 '10 at 22:05
feedback

Your Answer

 
or
required, but never shown

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