typescript - neovim 未按预期自动格式化
我正在使用 neovim、vim-autoformat,并且有一个像这样的 .editorconfig 配置:
root = true
[*]
indent_style = spaces
indent_size = 2
这是我所期望的:
然而,当我运行 :Autoformat 时,我得到的是这个
我已经确认这是从 .editorconfig 读取的,因为当我更改制表符长度时,我可以从 :Autoformat 看到它明显的变化,然而,它似乎确实在插入制表符,而且缩进也不像人们期望的那样。
我在这里做错了什么,这应该如何配置才能把制表符期望传递给第一张图片?
答案#1
这是因为默认格式化程序很可能设置不正确。我可以通过运行 :Autoformat typescript 来强制使用格式化程序,这会给我预期的缩进。


