octavz / nvim-metals

A Metals plugin for Nvim

Home Page:https://scalameta.org/metals/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nvim-metals logo

nvim-metals

nvim-metals is a Lua plugin built to provide a better experience while using Metals, the Scala Language Server, with Neovim's built-in LSP support. This plugin provides the necessary commands you'll need to develop with nvim and Metals. This extension also implements the custom Metals LSP extensions that will give you a much richer experience than just using Metals with the default nvim-lspconfig setup, as well as automatically setting all of the correct init_options, and offering some integrations with other projects such as nvim-dap and Telescope.

link to discord link to help docs

Prerequisites

  • Before you get started you need to ensure that you are using nvim v.0.6.0 or newer.
  • Ensure Coursier is installed on your machine. nvim-metals uses Coursier to download and update Metals.
  • Remove F from shortmess. set shortmess-=F (for lua vim.opt_global.shortmess:remove("F")) NOTE: Without doing this, autocommands that deal with filetypes prohibit messages from being shown, so some of the messages we show to help users get started may not be shown. If you're confident you don't need help setting up, then just remove this, and nvim-metals will work fine, but any log messages won't actually be shown to you if something goes wrong with nvim-metals.
  • Ensure that you have mappings created for functionality that you desire. By default methods for things like goto definition, find references, etc are there, but not automatically mapped. You can find a minimal example configuration here.
  • This plugin relies on plenary.nvim which you're more than likely already relying on for other plugins. However, make sure to also have this installed.
  • Subscribe to this discussion which will notify you of any breaking changes.

Installation

NOTE: This plugin works without needing to install neovim/nvim-lspconfig. If you have it installed for other languages, that's not a problem, but make sure you do not have Metals configured through nvim-lspconfig while using this plugin. If you have metals setup registered with nvim-lspconfig, you'll want to remove it.

nvim-metals is just a plugin installed like any other Neovim plugin. For example if using packer:

use({'scalameta/nvim-metals', requires = { "nvim-lua/plenary.nvim" }})

Getting started

To get started with nvim-metals, please read :help nvim-metals. This will give you a thorough overview of the setup and settings.

Features

To see a full list of features, check out the Features List.

Settings and Commands

To view all of the available commands, check out :help metals-commands in the help docs. Similarly, to see the available configuration options, check out :help metals-options, and :help metals-settings for settings.

NOTE: You can find an example of a minimal configuration showing how to set various settings and options here.

Integrations

To see the full details on the available configurations, checkout out :help metals-integrations. The currently available integrations are:

About

A Metals plugin for Nvim

https://scalameta.org/metals/

License:Apache License 2.0


Languages

Language:Lua 99.2%Language:Makefile 0.7%Language:Vim Script 0.1%