vim-polyglot icon indicating copy to clipboard operation
vim-polyglot copied to clipboard

Disabling yaml support

Open Subbeh opened this issue 2 years ago • 3 comments

I'm having issues with indented comments in YAML files.

Adding let g:polyglot_disabled = ['yaml'] does not seem to make a difference, while disabling the plugin altogether resolves it.

Is there any way to see where this is being triggered?

Subbeh avatar Jul 16 '22 06:07 Subbeh

Are you adding it before loading polyglot?

From the docs:

Individual language packs can be disabled by setting g:polyglot_disabled [...]

Please declare this variable before polyglot is loaded (at the top of .vimrc)

Looks like it sets g:polyglot_is_disabled to 1 for the desired filetype on init. Then at each plugin it checks for the key in g:polyglot_is_disabled. So adding it before loading polyglot should do the trick.

What does :echo g:polyglot_is_disabled return for you?

jpesce avatar Aug 16 '22 21:08 jpesce

I also have problems with vim-polyglot's YAML file indentation, more than just YAML comments, seems everywhere.

I also observe no change with the following before vim-polyglot is loaded:

let g:polyglot_disabled = ['yaml']

I have success with set indentexpr= after vim-polygot is loaded. Appears vim-polygot doesn't respect g:polyglot_disabled = ['yaml'] when it executes set indentexpr=GetYAMLIndent(v:lnum). As for why vim-polyglot's GetYAMLIndent doesn't work as expected I have no idea. No combination of smartindent or autoindent settings appears to improve whatever GetYAMLIndent does.

rene-descartes2021 avatar Sep 26 '22 19:09 rene-descartes2021