Not all major modes handle the indent the same way, so you may have to make some adjustments to certain modes to get the behavior you need. Often they will have their own indentation settings, for example. cperl-indent-level.
In modes based on cc-modefor C-like languages, something like this should do what you want:
(setq-default indent-tabs-mode t)
(setq-default tab-width 4) ; Assuming you want your tabs to be four spaces wide
(defvaralias 'c-basic-offset 'tab-width)
Please note that there are some interesting situations that may arise when using tabs for indentation. EmacsWiki Home
Chris source
share