If you can’t work hard to install the plugin for such an easy task (I couldn’t), try this simple mapping:
:inoremap <CD> <Esc>:call setline(".",substitute(getline(line(".")),'^\s*',matchstr(getline(line(".")-1),'^\s*'),''))<CR>I
Now, Ctrl D in insert mode performs the action: indent the current line, like the previous line.
This works best before you start typing on a new line, because it will only reset the cursor after the indent.
glts
source share