I agree with Tyler; although this is a bit complicated, you will be better off in the long run if you try to understand and configure the default indentation features. The Emacs Wiki has good resources , and there are other relevant Q & As here when stack overflowing.
insert-tab , indent-region , .
, :
1) (java-insert-tab) (css-insert-tab) (javascript-insert-tab) .., ... , , , . .
2) (local-set-key ...) , (define-key (current-local-map) ...), , , , .
(defun my-coding-config ()
(setq tab-width 4)
(setq indent-tabs-mode t)
(local-set-key (kbd "<tab>") 'my-insert-tab))
(defun my-insert-tab (&optional arg)
(interactive "P")
(insert-tab arg))
my-coding-config . , , :
;; Use my coding hook for all programming modes
(mapcar
(lambda (language-mode-hook)
(add-hook language-mode-hook 'my-coding-config))
'(java-mode-hook
javascript-mode-hook
css-mode-hook
...))
3) C-h v tab-width RET, indent-tabs-mode, , : " -, ".
(set-default 'indent-tabs-mode t), . , , , .