Change tab width in emacs
<p>I added lines from this website
<a href="https://www.emacswiki.org/emacs/IndentationBasics" rel="noreferrer">https://www.emacswiki.org/emacs/IndentationBasics</a>
to my <code>~/.emacs</code> file:</p>

<pre><code>  (setq-default indent-tabs-mode nil)
  (setq tab-width 4)
  (defvaralias 'c-basic-offset 'tab-width)
</code></pre>

<p>And it made my tabs in <code>.h</code> files and <code>.cpp</code> files 8 spaces long (before they were 2 spaces long).
How to make them 4 spaces long? </p>