Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
@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

1 Answer

up vote 12 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.

share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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