Vim autoindent indents incorrectly
<p>When writing code in vim, I've noticed that it sometimes messes up the indentation of the current line after pressing return.  (In the gif, I go into insert mode, with the cursor at the end of the date function. When I press return, the whole "echo date('Y');" part looses its indentation when it should not).</p>

<p><a href="https://i.stack.imgur.com/6EEJL.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6EEJL.gif" alt="Vim"></a></p>

<p>I have a ton of directives in my vimrc to try and stop all kinds of autoindentation, but much to my irritation, the problem persists.</p>

<pre><code>filetype plugin indent off
filetype plugin off
set noautoindent
set nosmartindent
set nocindent
set indentexpr=''
let b:did_indent = 1
set ft?
filetype indent off
</code></pre>

<p>I wish there was a way to have vim indent files much like your "more standard" text editors, whereby they don't try to be smart, but just maintain the current indentation of the current line in the new line. Like this:</p>

<p><a href="https://i.stack.imgur.com/nyN9u.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nyN9u.gif" alt="Gedit"></a></p>

<p>Is this possible?</p>