INTRODUCTION *efmls-configs* *efmls* An unofficial collection of linters and formatters configured for efm-langserver to work with the builtin nvim-lsp. Check out |efmls-configs-supported| for a list of supported languages. TABLE OF CONTENTS SETUP ......................................... |efmls-configs-setup| DEFAULT CONFIGURATIONS ..................... |efmls-configs-defaults| TROUBLESHOOTING ..................... |efmls-configs-troubleshooting| EFM-LANGSERVER SCHEMA ........................ |efmls-configs-schema| SUPPORTED LINTERS AND FORMATTERS .......... |efmls-configs-supported| SETUP *efmls-configs-setup* To get started, make a `languages` table that define the linters/formatters for the language. Or use the defaults provided by this plugin if you don't want to list for each language. >lua -- Register linters and formatters per language local languages = { typescript = { require('efmls-configs.linters.eslint'), require('efmls-configs.formatters.prettier'), }, lua = { require('efmls-configs.formatters.stylua'), }, } -- Or use the defaults provided by this plugin -- check doc/SUPPORTED_LIST.md for all the defaults provided -- -- local languages = require('efmls-configs.defaults').languages() local efmls_config = { filetypes = vim.tbl_keys(languages), settings = { rootMarkers = { '.git/' }, languages = languages, }, init_options = { documentFormatting = true, documentRangeFormatting = true, }, } -- If using nvim >= 0.11 then use the following vim.lsp.config('efm', vim.tbl_extend('force', efmls_config, { cmd = { 'efm-langserver' }, -- Pass your custom lsp config below like on_attach and capabilities -- -- on_attach = on_attach, -- capabilities = capabilities, })) -- If using nvim <= 0.10 then use the following require('lspconfig').efm.setup(vim.tbl_extend('force', efmls_config, { -- Pass your cutom config below like on_attach and capabilities -- -- on_attach = on_attach, -- capabilities = capabilities, })) < DEFAULT CONFIGURATIONS *efmls-configs-defaults* Default configurations are an opt-in feature. To see all the configurations provided by default go to https://github.com/creativenull/efmls-configs-nvim/blob/main/doc/SUPPORTED_LIST.md You can use a list of defaults provided by this plugin, in-case you don't want to specify configuration for each language. >lua local languages = require('efmls-configs.defaults').languages() < To extend and add additional tools or to override existing defaults registered: >lua local languages = require('efmls-configs.defaults').languages() languages = vim.tbl_extend('force', languages, { -- you custom languages, or overrides html = { require('efmls-configs.formatters.prettier') } }) < TROUBLESHOOTING *efmls-configs-issues* Always run `:checkhealth` to see if there are any issue, when you get no response from the linter or formatter as you expected. If you get "no executable found" issues in `:checkhealth`, this means that the linter or formatter was not found in the provided filepath. Ensure that it is installed globally or in a valid filepath. For nodejs/npm, php/composer, ruby/bundler: check if the linter or formatter is installed in your node_modules (npm), vendor (composer/bundler) project folder, or installed globally. MASON *efmls-configs-mason* If you use mason, then you don't need to add anything extra for efmls-configs for it to work. But if you are having problems setting up then check the following: 1. Make sure you call mason `setup()` before `vim.lsp.config('efm', {...})` (if using nvim 0.10 and below, then make sure it's before lspconfig `setup()`) 2. Run `:!which ` to check if the path is provided by mason EFM-LANGSERVER SCHEMA FILE *efmls-configs-schema* https://github.com/mattn/efm-langserver/blob/master/schema.json SUPPORTED LINTERS AND FORMATTERS *efmls-configs-supported* https://github.com/creativenull/efmls-configs-nvim/blob/main/doc/SUPPORTED_LIST.md vim:tw=78:ts=8:noet:ft=help:norl: