Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smartindent breaks indented comments #16

Closed
gmarmstrong opened this issue Apr 19, 2018 · 6 comments
Closed

smartindent breaks indented comments #16

gmarmstrong opened this issue Apr 19, 2018 · 6 comments

Comments

@gmarmstrong
Copy link

gmarmstrong commented Apr 19, 2018

Using set smartindent causes comments not indent. After using o 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 minimal init.vim.

Likely culprit: 1e32fe7

@LnL7
Copy link
Owner

LnL7 commented Apr 21, 2018

Could you give an example?

@gmarmstrong
Copy link
Author

:set smartindent causes this:

smartindent

@LnL7
Copy link
Owner

LnL7 commented Apr 21, 2018

Weird, that doesn't happen for me. I'll try to reproduce with a minimal vim_configurable.

@gmarmstrong
Copy link
Author

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 (neovim/neovim#7702), so I'll just disable that option in my config. Thanks!

@peperunas
Copy link

I have the same issue. I'm running neovim 0.4.4.

I have set noautoindent and set nosmartindent and the issue persists.

@ryan4yin
Copy link

@peperunas NVIM v0.9.1 here, and everything works fine after set nosmartindent.

According to LunarVim/LunarVim#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants