Take a look at our new Article and Redactor X editors.
This example shows how to set up tab key to use spaces instead of tabulation.
<!-- element -->
<textarea id="content"></textarea>
<!-- call -->
<script>
$R('#content', { tabAsSpaces: 4 });
</script>