{"id":13409488,"url":"https://github.com/scalameta/nvim-metals","last_synced_at":"2025-10-18T22:37:37.326Z","repository":{"id":37749878,"uuid":"259041687","full_name":"scalameta/nvim-metals","owner":"scalameta","description":"A Metals plugin for Neovim","archived":false,"fork":false,"pushed_at":"2024-09-16T17:13:35.000Z","size":5572,"stargazers_count":463,"open_issues_count":26,"forks_count":73,"subscribers_count":22,"default_branch":"main","last_synced_at":"2024-09-16T21:14:44.046Z","etag":null,"topics":["lsp","nvim","nvim-lsp","scala"],"latest_commit_sha":null,"homepage":"https://scalameta.org/metals/","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scalameta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":"ckipp01"}},"created_at":"2020-04-26T13:47:22.000Z","updated_at":"2024-09-16T17:13:39.000Z","dependencies_parsed_at":"2024-02-13T15:42:22.932Z","dependency_job_id":"87ae2c61-87b8-47cc-8478-69830e65ee5f","html_url":"https://github.com/scalameta/nvim-metals","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalameta%2Fnvim-metals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalameta%2Fnvim-metals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalameta%2Fnvim-metals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalameta%2Fnvim-metals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scalameta","download_url":"https://codeload.github.com/scalameta/nvim-metals/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685628,"owners_count":20979085,"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":["lsp","nvim","nvim-lsp","scala"],"created_at":"2024-07-30T20:01:01.275Z","updated_at":"2025-10-18T22:37:37.319Z","avatar_url":"https://github.com/scalameta.png","language":"Lua","funding_links":["https://github.com/sponsors/ckipp01"],"categories":["LSP","Lua"],"sub_categories":["(requires Neovim 0.5)"],"readme":"![nvim-metals logo](https://i.imgur.com/7gqEQOi.png)\n\n# nvim-metals\n\n`nvim-metals` is a Lua plugin built to provide a better experience while using\nMetals, the Scala Language Server, with Neovim's built-in [LSP\nsupport](https://neovim.io/doc/user/lsp.html).[^no-lspconfig] You can see all\nthe available features\n[here](https://github.com/scalameta/nvim-metals/discussions/279).\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://discord.gg/FaVDrJegEh\"\u003e\n        \u003cimg alt=\"link to discord\" src=\"https://img.shields.io/discord/632642981228314653?style=flat-square\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/scalameta/nvim-metals/blob/master/doc/metals.txt\"\u003e\n        \u003cimg alt=\"link to help docs\" src=\"https://img.shields.io/badge/docs-%3Ah%20nvim--metals-blue?style=flat-square\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## Prerequisites\n\n- Before you get started you need to ensure that you are using the latest nvim\nv.0.11.x or newer. If you're still on an older version then you'll want to target the\ntag that matches your release version.\n- Ensure [Coursier](https://get-coursier.io/docs/cli-installation) is\n    installed locally.[^coursier]\n- Ensure that you have all the LSP mappings for the core functionality you want\n    setup.[^mappings]\n- Subscribe to [this\n    discussion](https://github.com/scalameta/nvim-metals/discussions/253) which\n    will notify you of any breaking changes.\n- Unfamiliar with Lua and Neovim? Check out the great\n    [`:h lua-guide`](https://neovim.io/doc/user/lua-guide.html#lua-guide).\n\n## Getting started\n\n_NOTE_: This plugin works without needing to install\n[neovim/nvim-lspconfig](https://github.com/neovim/nvim-lspconfig). If you have\nit installed for other languages, that's not a problem, but make sure you do not\nhave Metals configured through `nvim-lspconfig` while using this plugin.[^no-lspconfig]\n\n## Absolute minimal example using [Lazy.nvim](https://github.com/folke/lazy.nvim)\n\n```lua\n{\n  \"scalameta/nvim-metals\",\n  ft = { \"scala\", \"sbt\", \"java\" },\n  opts = function()\n    local metals_config = require(\"metals\").bare_config()\n    metals_config.on_attach = function(client, bufnr)\n      -- your on_attach function\n    end\n\n    return metals_config\n  end,\n  config = function(self, metals_config)\n    local nvim_metals_group = vim.api.nvim_create_augroup(\"nvim-metals\", { clear = true })\n    vim.api.nvim_create_autocmd(\"FileType\", {\n      pattern = self.ft,\n      callback = function()\n        require(\"metals\").initialize_or_attach(metals_config)\n      end,\n      group = nvim_metals_group,\n    })\n  end\n}\n```\n\n**NOTE**: The above assumes you have your own attach function that sets up all\nyour LSP mappings. It also doesn't make use of _any_ configuration. You'll\nlikely want a more involved setup than this, so check out the full minimal\nexample configuration link below.\n\n- You can find a full [minimal example configuration\n    here](https://github.com/scalameta/nvim-metals/discussions/39).\n- You can find the full documentation with [`:help\n    nvim-metals`](https://github.com/scalameta/nvim-metals/blob/main/doc/metals.txt).\n- You can find a full [list of features here](https://github.com/scalameta/nvim-metals/discussions/279).\n\n### Settings and Commands\n\nTo view all of the available commands, check out `:help metals-commands` in the\nhelp docs. Similarly, to see the available configuration settings check out\n`:help metals-settings`.\n\n## Integrations\n\nTo see the full details on the available configurations, checkout out `:help\nmetals-integrations`. The currently available integrations are:\n- [nvim-dap](https://github.com/mfussenegger/nvim-dap)\n- [Telescope](https://github.com/nvim-telescope/telescope.nvim)\n\n\n[^no-lspconfig]: If you're familiar with nvim and LSP you'll probably know of\n  [`nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig) which also has a\n  Metals configuration. Note that this is a very minimal version with no\n  specific Metals commands and no Metals extensions. You can see more info on\n  this [here](https://github.com/scalameta/nvim-metals/discussions/93). **DO\n  NOT** try to use Metals both with `nvim-lspconfig` and with `nvim-metals` as\n  stuff *will* not work right.\n[^coursier]: `nvim-metals` uses Coursier to download and update Metals. _NOTE_:\n  On Windows, you should run `coursier` or `cs.exe` once from the command line\n  as this is how it will install itself. Once this is done you should add\n  `C:\\Users\\YOURNAME\\AppData\\Coursier\\data\\bin` to your path. To verify that it\n  is properly installed you can run `cs --help` from a new shell.\n[^mappings]: By default methods for things like goto definition, find\n  references, etc are there, but not automatically mapped. You can find a\n  minimal example configuration\n  [here](https://github.com/scalameta/nvim-metals/discussions/39).\n  However, make sure to also have this installed as Metals uses it for things\n  like Jobs, popups, and paths.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalameta%2Fnvim-metals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscalameta%2Fnvim-metals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalameta%2Fnvim-metals/lists"}