nvim-lua / kickstart.nvim

A launch point for your personal nvim configuration
MIT License
16.93k stars 17.04k forks source link

Newb question: Where do I file a bug for the autocomplete for CSS files? #897

Closed genericrohan closed 2 months ago

genericrohan commented 2 months ago

Hi, I'm new to coding and just learning nvim because I hate making progress in my life and prefer side-quests instead, apparently. Anyway...

I am using nvim w/ kickstart's config to edit a .css file and when I try to write css for the * selector, the...autocomplete...thing (idk what it's called) seems to treat it as a multi-line comment. What I mean is, if I start with:

* {}

and then press <Enter> with my cursor between the braces, I end up with:

* {
        * 
* }

instead of

* {

}

image

I know it's probably some plugin or something that does this, but I'm not sure which one or which one I should file the actual bug report with. I asked ChatGPT and it said that tree-sitter-css is only for syntax highlighting and since it's the only css thing I remember installing during the setup of neovim, I'm not sure what else to look for.

If someone can point me in the right direction, that would be appreciated.

dam9000 commented 2 months ago

Treesitter taks care of: highlighting, indenting, incremental selection. Any of these can be disabled with :TSDisable: image However, the behaviour you described is not caused by Treesitter, I tried running plain nvim without any plugins nvim --clean and it behaves the same, so it must be caused by some built-in rules. I was not able to disable this and I tried: :set nocindent :set noautoindent :set nosmartindent See: :help indent for more info about the above (https://neovim.io/doc/user/indent.html) Sorry I don't have a solution, just some additional info for context. Perhaps someone else will be able to answer this.

dam9000 commented 2 months ago

I went digging around the nvim runtime files for css:

/usr/share/nvim/runtime/indent/css.vim
/usr/share/nvim/runtime/ftplugin/css.vim
/usr/share/nvim/runtime/ftplugin/css.lua
/usr/share/nvim/runtime/syntax/css.vim

And found these additional options:

setlocal omnifunc=csscomplete#CompleteCSS
setlocal indentexpr=GetCSSIndent()

However, what is causing the described behaviour is:

setlocal comments=s1:/*,mb:*,ex:*/ commentstring&

And can be disabled with:

:set comments=

This should probably be refined further, but I guess it's a starting point.

feoh commented 2 months ago

@dam9000 Thanks a bunch for digging in!

In any case, please feel free to file a bug against the main Neovim repo for runtime improvements. This isn't a kickstart issue.