Re:NeoVim 0.2.0 released
by thomastjeffery on Tuesday May 02, 2017 @05:04PM
(#14250573)
> Still having trouble with identation, though. vim is just smarter ...
While that is still generally true in my experience, it helps a lot to set c-style indentation to linux-style instead of gnu-style.
From the top of my .emacs:
(setq c-default-style "linux"
c-basic-offset)FWIW, I disable electric-indent globally and use C-j instead of RET which indents after new-line (it's bound to electric-newline-and-maybe-indent, I believe it's the default binding):
C-j runs the command electric-newline-and-maybe-indent (found in global-map), which is an interactive compiled Lisp function in ‘electric.el’.
It is bound to C-j.
(electric-newline-and-maybe-indent)
Insert a newline. If ‘electric-indent-mode’ is enabled, that’s that, but if it is disabled then additionally indent according to major mode. Indentation is done using the value of ‘indent-line-function’. In programming language modes, this is the same as TAB. In some text modes, where TAB inserts a tab, this command indents to the column specified by the function ‘current-left-margin’.
Still having trouble with identation, though. vim is just smarter ...