David Gomes
David Gomes

Reputation: 5835

Tell Emacs never to insert Tabs

I know how I can make it so that hitting doesn't insert a tab, but spaces.

However, Emacs keeps using tabs for indentation, like:

space space
space space space
tab tab space space
tab tab tab space space space

It's a messy mix, how can I configure it so that it never inserts tabs, for anything?

Upvotes: 30

Views: 9061

Answers (2)

Bozhidar Batsov
Bozhidar Batsov

Reputation: 56655

Add this to your .emacs:

(setq-default indent-tabs-mode nil)

Upvotes: 46

Miserable Variable
Miserable Variable

Reputation: 28761

Check the variable indent-tabs-mode. If you set it to nil then emacs will use spaces to indent to the tab-stop when you press tab and never convert spaces to tabs.

Upvotes: 11

Related Questions