{"id":13409693,"url":"https://github.com/creativenull/efmls-configs-nvim","last_synced_at":"2025-05-16T03:07:09.194Z","repository":{"id":38184827,"uuid":"420518435","full_name":"creativenull/efmls-configs-nvim","owner":"creativenull","description":"An unofficial collection of linters and formatters configured for efm-langserver for neovim.","archived":false,"fork":false,"pushed_at":"2025-03-30T13:14:56.000Z","size":279,"stargazers_count":292,"open_issues_count":1,"forks_count":45,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-19T04:45:53.182Z","etag":null,"topics":["efm-langserver","formatters","linters","lua","neovim","nvim-lsp","nvim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/creativenull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-10-23T20:40:42.000Z","updated_at":"2025-04-18T02:09:24.000Z","dependencies_parsed_at":"2023-01-19T15:17:06.143Z","dependency_job_id":"cdf58e85-879d-42a0-ac01-33e98c09764c","html_url":"https://github.com/creativenull/efmls-configs-nvim","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativenull%2Fefmls-configs-nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativenull%2Fefmls-configs-nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativenull%2Fefmls-configs-nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativenull%2Fefmls-configs-nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creativenull","download_url":"https://codeload.github.com/creativenull/efmls-configs-nvim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254459088,"owners_count":22074605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["efm-langserver","formatters","linters","lua","neovim","nvim-lsp","nvim-plugin"],"created_at":"2024-07-30T20:01:02.821Z","updated_at":"2025-05-16T03:07:04.185Z","avatar_url":"https://github.com/creativenull.png","language":"Lua","funding_links":[],"categories":["LSP","Lua"],"sub_categories":["(requires Neovim 0.5)"],"readme":"# efmls-configs-nvim\n\n\u003ca href=\"https://dotfyle.com/plugins/creativenull/efmls-configs-nvim\"\u003e\n  \u003cimg src=\"https://dotfyle.com/plugins/creativenull/efmls-configs-nvim/shield\" alt=\"Configs on dotfyle\"\u003e\n\u003c/a\u003e\n\nAn unofficial collection of linters and formatters configured for [efm-langserver][efm-langserver] for neovim.\n\n## Supported linters and formatters\n\n[doc/SUPPORTED_LIST.md](./doc/SUPPORTED_LIST.md)\n\n## Features\n\n- Out-of-box configurations for 90+ tools (linters and formatters)\n- Intelligently detect tools installed project-wide or system-wide - works only for node/npm, php/composer and\n  ruby/bundler (additional support for other build tools coming soon, welcome any contributions)\n- `:checkhealth` integration for status check\n\n## Documentation\n\nDocumentation can be accessed via [`:help efmls-configs`](./doc/efmls-configs.txt) or [further below](#setup).\n\n## Requirements\n\n- [Neovim \u003e= 0.7][neovim]\n- [efm-langserver][efm-langserver] installed globally. If using [mason.nvim](https://github.com/williamboman/mason.nvim)\n  then install with `:MasonInstall efm`.\n\n## Installation\n\nInstall with your favorite plugin manager or just use builtin packages.\n\n### lazy.nvim\n\n```lua\n{\n  'creativenull/efmls-configs-nvim',\n  version = 'v1.x.x', -- version is optional, but recommended\n  dependencies = { 'neovim/nvim-lspconfig' },\n}\n```\n\n### packer.nvim\n\n```lua\nuse {\n  'creativenull/efmls-configs-nvim',\n  tag = 'v1.*', -- tag is optional, but recommended\n  requires = { 'neovim/nvim-lspconfig' },\n}\n```\n\n### vim-plug\n\n```vim\nPlug 'neovim/nvim-lspconfig'\nPlug 'creativenull/efmls-configs-nvim', { 'tag': 'v1.*' } \" tag is optional, but recommended\n```\n\n## Setup\n\nSee also `:help efmls-configs-setup` to view docs inside neovim.\n\nTo get started, make a `languages` table that will define configurations for the language of your choice. Or use the\ndefaults provided by this plugin.\n\n```lua\n-- Register linters and formatters per language\nlocal eslint = require('efmls-configs.linters.eslint')\nlocal prettier = require('efmls-configs.formatters.prettier')\nlocal stylua = require('efmls-configs.formatters.stylua')\nlocal languages = {\n  typescript = { eslint, prettier },\n  lua = { stylua },\n}\n\n-- Or use the defaults provided by this plugin\n-- check doc/SUPPORTED_LIST.md for the supported languages\n--\n-- local languages = require('efmls-configs.defaults').languages()\n\nlocal efmls_config = {\n  filetypes = vim.tbl_keys(languages),\n  settings = {\n    rootMarkers = { '.git/' },\n    languages = languages,\n  },\n  init_options = {\n    documentFormatting = true,\n    documentRangeFormatting = true,\n  },\n}\n\nrequire('lspconfig').efm.setup(vim.tbl_extend('force', efmls_config, {\n  -- Pass your custom lsp config below like on_attach and capabilities\n  --\n  -- on_attach = on_attach,\n  -- capabilities = capabilities,\n}))\n```\n\n### Default Configurations\n\nSee also `:help efmls-configs-defaults` to view docs inside neovim.\n\nDefault configurations are an opt-in feature. To see all the configurations provided by default go to\n[`doc/SUPPORTED_LIST.md`](./doc/SUPPORTED_LIST.md).\n\nYou can use a list of defaults provided by this plugin, in-case you don't want to specify configuration\nfor each language.\n\n```lua\nlocal languages = require('efmls-configs.defaults').languages()\n```\n\nTo add additional tools which are not provided by default you can extend via `vim.tbl_extend()`. This can also be used\nas a way to override defaults.\n\n```lua\nlocal languages = require('efmls-configs.defaults').languages()\nlanguages = vim.tbl_extend('force', languages, {\n  -- Custom languages, or override existing ones\n  html = {\n    require('efmls-configs.formatters.prettier'),\n  },\n})\n```\n\n### Tips and Tricks\n\n#### Format on save\n\nThere are couple ways you can format your code on save.\n\n1. Register an autocmd to run format on save:\n\n```lua\nlocal lsp_fmt_group = vim.api.nvim_create_augroup('LspFormattingGroup', {})\nvim.api.nvim_create_autocmd('BufWritePost', {\n  group = lsp_fmt_group,\n  callback = function(ev)\n    local efm = vim.lsp.get_active_clients({ name = 'efm', bufnr = ev.buf })\n\n    if vim.tbl_isempty(efm) then\n      return\n    end\n\n    vim.lsp.buf.format({ name = 'efm' })\n  end,\n})\n```\n\n2. If you do not want to write and maintain the code above, then you can rely on a plugin like\n[lukas-reineke/lsp-format.nvim][lsp-format] which makes it easier to format on save.\n\n## Troubleshooting\n\nSee also `:help efmls-configs-issues` to view docs inside neovim.\n\nAlways run `:checkhealth` to see if there are any issue, when you get no response from the linter or formatter\nas you expected.\n\nIf you get \"no executable found\" issues in `:checkhealth`, this means that the linter or formatter was not found in the\nprovided filepath. Ensure that it is installed globally or in a valid filepath.\n\nFor nodejs/npm, php/composer, ruby/bundler: check if the linter or formatter is installed in your node_modules (npm),\nvendor (composer/bundler) project folder, or installed globally.\n\n### Mason setup issue (`:help efmls-configs-mason`)\n\nIf you use mason, then you don't need to add anything extra for efmls-configs for it to work. But if you are having\nproblems setting up then check the following:\n\n1. Make sure you call mason `setup()` before efm `setup()`\n2. Run `:!which \u003ctool\u003e` to check if the path is provided by mason\n\n## Alternatives\n\n- ALE - [https://github.com/dense-analysis/ale](https://github.com/dense-analysis/ale)\n- diagnostic-languageserver - [https://github.com/iamcco/diagnostic-languageserver](https://github.com/iamcco/diagnostic-languageserver)\n- guard.nvim - [https://github.com/nvimdev/guard.nvim](https://github.com/nvimdev/guard.nvim)\n- nvim-lint - [https://github.com/mfussenegger/nvim-lint](https://github.com/mfussenegger/nvim-lint)\n- formatter.nvim - [https://github.com/mhartington/formatter.nvim](https://github.com/mhartington/formatter.nvim)\n\n## Credits\n\nCredits goes to the following projects for inspiration:\n\n- [efm-langserver][efm-langserver] for this awesome language server to provide an interface to run linters/formatters\n  through a LSP protocol\n- [ALE][ale] for a huge list of linters/formatters to look through and add them in here\n\n[efm-langserver]: https://github.com/mattn/efm-langserver\n[schema-file]: https://github.com/mattn/efm-langserver/blob/master/schema.json\n[ale]: https://github.com/dense-analysis/ale\n[nvim-lsp]: https://neovim.io/doc/user/lsp.html\n[neovim]: https://github.com/neovim/neovim\n[lspconfig]: https://github.com/neovim/nvim-lspconfig\n[lsp-format]: https://github.com/lukas-reineke/lsp-format.nvim\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreativenull%2Fefmls-configs-nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreativenull%2Fefmls-configs-nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreativenull%2Fefmls-configs-nvim/lists"}