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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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

share|improve this question

marked as duplicate by Tog, Marcks Thomas, kmarsh, Heptite, Excellll Mar 7 '14 at 15:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new 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
up vote 13 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 for details. – phils Jul 1 '10 at 22:05

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