title: How can I make emacs indentation behaviour like phpstorm/eclipse?
body: <p>I'm  new to emacs and trying desperately to make it behave the way I've gotten used to over the last few years with my IDEs.</p>
  
  <p>I love a lot of the stuff it's doing but I am taking issue with its indentation practices.</p>
  
  <p>What I want:</p>
  
  <ul>
  <li>4 spaces instead of tab</li>
  <li>Pressing enter to put the cursor on the same column as where the previous line starts</li>
  <li>Pressing tab inserts 4 spaces regardless of whatever the 'smart' indentation might think is correct</li>
  <li>Pressing tab when using neotree-dir should try to resolve the path normally</li>
  </ul>
  
  <p>I've managed to get 2/4 with <a href="https://github.com/zorgnax/regtab" rel="nofollow noreferrer">https://github.com/zorgnax/regtab</a>.
  Unfortunately, that solution breaks the path resolve in neotree.</p>
  
  <p>EDIT: Thought it would make sense to show my .emacs config for this</p>
  
  <pre><code>(setq-default indent-tabs-mode nil)
  (setq-default tab-width 4)
  (add-to-list 'load-path "~/.emacs.d/plugins/")
  (load "regtab.el")
  (define-globalized-minor-mode my-global-regtab-mode regtab-mode
    (lambda() (regtab-mode 1)))
  (my-global-regtab-mode 1)
  (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
  </code></pre>
  
  <p>Electric-indent-mode is turned off because if I indent a line in what it thinks is an 'invalid way', and then press RET, it 'corrects' my indentation. It does the same thing for the whole file when I use C-y</p>
  
  <p>The reason you would want to make 'invalid' indentation is that certain libraries use what is essentially invalid html/js syntax.</p>
  
  <p>EDIT2:
  Replacing</p>
  
  <pre><code>(when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
  </code></pre>
  
  <p>with </p>
  
  <pre><code>(setq-default electric-indent-inhibit t)
  </code></pre>
  
  <p>has sort of helped. It no longer forces weird indentation onto me but now it at least indents somewhat when pressing RET and no longer ruins my indents when using C-y.</p>
  
  <p>What's left now is to somehow achieve what regtab does without screwing up  path resolve for M-x commands.</p>