Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I have a standard LSP config https://github.com/neovim/nvim-lspconfig#keybindings-and-completion and the f seems to work with both and not conflict. Everything seems perfect, and no need for the insanely complex efm. ``` augroup formatting autocmd! autocmd FileType sh setlocal formatprg=shfmt\ -i\ 4 autocmd FileType markdown setlocal formatprg=prettier\ --parser\ markdown autocmd FileType css setlocal formatprg=prettier\ --parser\ css autocmd FileType html setlocal formatprg=prettier\ --parser\ html autocmd FileType json setlocal formatprg=prettier\ --parser\ json " use deno LSP for formatting these instead " autocmd FileType javascript setlocal formatprg=prettier\ --parser\ typescript " autocmd FileType javascript.jsx setlocal formatprg=prettier\ --parser\ typescript " autocmd FileType typescript setlocal formatprg=prettier\ --parser\ typescript augroup END
I'm following along with this post and the associated dotfiles.
I've used inspect.lua to inspect the client table and I can see valid-looking formatCommand settings (using the exact efm folder that u/lukas-reineke uses)
The only wrinkle I can think of is that I'm using nvim-lspinstall. But efm is definitely loaded and configured as expected, so I don't think that's it, unless it's doing something really weird I can't see.
I’ve personally never gotten efm to work at all, and I never figured out why (much like your situation). I use diagnostic-languageserver, which worked like a charm the first time. I’ve heard some users say it’s slower (TypeScript versus Go), but I’ve never had any speed issues.
this plugin does the trick for me: formatter.nvim