Losing my mind with formatting

This page summarizes the projects mentioned and recommended in the original post on /r/neovim

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • nvim-lspconfig

    Quickstart configs for Nvim LSP

  • 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

  • dotfiles

    My personal dotfiles. do not eat (by lukas-reineke)

  • I'm following along with this post and the associated dotfiles.

  • 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.

    WorkOS logo
  • inspect.lua

    Human-readable representation of Lua tables

  • 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)

  • nvim-lspinstall

    Discontinued Provides the missing :LspInstall for nvim-lspconfig

  • 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.

  • diagnostic-languageserver

    diagnostic language server integrate with linters

  • 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.

  • formatter.nvim

  • this plugin does the trick for me: formatter.nvim

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts