neovim not autoformatting as expected

105 Views Asked by At

I'm using neovim, vim-autoformat, and have a .editorconfig setup like so:

root = true

[*]
indent_style = spaces
indent_size = 2 

This is what I expect: enter image description here

however, when I run :Autoformat, this is what I get

enter image description here

I have confirmed that this is reading from .editorconfig, because when I change the tab length, I can see it visibly change from :Autoformat, however, it does appear that its inserting tabs, and it's also not indenting the way one would expect.

enter image description here

What am I doing wrong here, how should this be configured to deliver tabbing expectation to the first image?

1

There are 1 best solutions below

0
jamesdlivesinatree On

This is because the default formatter is most likely incorrectly set. I can force the formatter by running :Autoformat typescript, which gives me the indentation i'd expect.