Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 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
add comment

1 Answer 1

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 emacswiki.org/emacs/CategoryIndentation for details. –  phils Jul 1 '10 at 22:05
add comment

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