Closed gmarmstrong closed 6 years ago
Could you give an example?
:set smartindent
causes this:
Weird, that doesn't happen for me. I'll try to reproduce with a minimal vim_configurable
.
I tried using the same minimal ~/.vimrc with Neovim and Vim 8.0. The issue only appears in Neovim.
Looks like Neovim usually interacts differently with smartindent
(https://github.com/neovim/neovim/issues/7702), so I'll just disable that option in my config. Thanks!
I have the same issue. I'm running neovim 0.4.4
.
I have set noautoindent
and set nosmartindent
and the issue persists.
@peperunas NVIM v0.9.1 here, and everything works fine after set nosmartindent
.
According to https://github.com/LunarVim/LunarVim/issues/3219, smartindent
is deprecated in favor of cindent
and should not be set.
neovim's docs for indentation:
'autoindent' uses the indent from the previous line.
'smartindent' is like 'autoindent' but also recognizes some C syntax to
increase/reduce the indent where appropriate.
'cindent' Works more cleverly than the other two and is configurable to
different indenting styles.
So just disable smartindent
and autoindent
.
Using
set smartindent
causes comments not indent. After usingo
to insert a new indented line, typing#
causes the line to lose its indentation. Editing the line before inserting the#
will work around this issue.This is in Neovim v0.2.2, with the latest
vim-nix
and a minimalinit.vim
.Likely culprit: https://github.com/LnL7/vim-nix/commit/1e32fe7265291723dc197fb05b28a5a61071a28b